CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    1

    set a variable with output from a command

    Here's something I need to do in an NT shell command which is very simple in unix. I want to set a variable with the result of another command. On unix, I can say "curdir=`pwd`" and the value of curdir will be set to the result of the pwd (print working directory) command. In Windows shell scripting this appears to be impossible! Can someone suggest a workaround?

  2. #2
    Join Date
    Jun 2004
    Posts
    142
    should find your answer here

    http://www.microsoft.com/technet/pro.../shellscr.mspx

    something like this?

    The current prompt text is stored in the PROMPT environment variable. Changing the prompt changes the value of this variable and vice versa. Thus, these two commands have the same effect:

    1. C:\>prompt [$p]
    2. C:\>set PROMPT=[$p]

    this as been quoted from that site
    Last edited by bobo; June 11th, 2004 at 08:46 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured