WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Environment

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Win95 environment after Winset

Keywords:    Win95 environment after Winset computername

Question:

We are attempting to set, then read, the 'computername' environment variable, from a Novel login script, on a Win95 workstation.

Basically from the Novel login script, we launch a compiled WinBatch script as follows:

#c:\wblogin.exe

The WinBatch script successfully reads some environment variables. It then executes WinSet, to set the computername environment variable. We then try to read that Environment variable, using the function 'Environment', or 'EnvItemize', with NO success. 'Environment' returns a blank string and EnvItemize doesn't show the changes to the environment.

Any ideas why?

Answer:

The problem is that the WinBatch script only reads those environment variable once, when it is executed. Therefore, it doesn't re-read any changes made by the WinSet command you executed from within the WinBatch script.

You will need to launch a second WinBatch script, which will pick up the changes made by the script that called the WinSet command.

#c:\SetEnviron.EXE ;script with WinSet command that sets environment #c:\GetEnviron.EXE ;script with Environment command that gets updated environment


Article ID:   W14455
Filename:   Win95 environment after Winset.txt
File Created: 2000:03:21:10:24:24
Last Updated: 2000:03:21:10:24:24