Announcement

Collapse
No announcement yet.

Reading from DOS environment

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading from DOS environment

    What OS?

    (You might try reading the values in from the registry if this is NT.)
    --[[ Indigo Rose Software Developer ]]

  • #2
    Reading from DOS environment

    Yet another question. Can't find any reference to "DOS" in the forum or the manual:

    Is there any way to retrieve the value of a DOS environmental variable. I have one called "NAME" which stores the userid as extracted from a Novell login script. I have assigned to another variable within SUF:

    ASSIGN VALUE (%UserID%=%NAME%)

    This does not work I suspect because SUF thinks %NAME% is an variable for use internally. This would be the way to assign in a DOS batch file but can't think how to extract within SUF. I then want to use the data to write away to the logged in user's home directory on the server.

    Any ideas anyone?

    Thanks again

    John

    Comment


    • #3
      Re: Reading from DOS environment

      Sorry. Win 95/98. I know how to do it from WinNT/2K/XP.

      Thanks

      John

      LATER: I have found an alternative way as noticed Netware stored the userID in the registry. But would still be interested to know if SUF can read DOS environmental variables.

      [This message has been edited by JXBURNS (edited 04-03-2002).]

      Comment


      • #4
        Re: Reading from DOS environment

        I don't think it can do it directly...but there is a way to do it by using a batch file to write the environment variable into a text file.

        Something like this:

        @echo %temp% >temp.txt
        ; automatically close the .bat on Win9x
        @cls
        @exit

        Put that in a batch file, and call it with an Execute Program action. Make sure you enable Wait for return, and set the Working directory appropriately (otherwise, the batch file won't work). Set the run mode to "Minimized" if you don't want the command line window appearing.

        Then use a Get Text Line action to get line 0 and store the result in a custom Setup Factory variable of your choice.
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Re: Reading from DOS environment

          Thanks for the info. Just as I thought - not easy to do directly. Appreciate the tip though.

          Rgds

          John

          Comment

          Working...
          X