bjshallenberger
asked on
How to set User Environment variable in vbscript and use it with Command Shell 'set' command
I have the following code in a vbscript:
Set WshShell = WScript.CreateObject("Wscr ipt.Shell" )
Set WshUserEnv = WshShell.Environment ("USER")
WshUserEnv("Test") = "123"
When I login the user, the variable 'Test' appears in the user's list of variables in the 'MyComputer'->'Properties' ->'Advance d'->'Envir onment Variables' window. However, if I type 'set' from the user's command prompt, the variable does not show up in the list (echo %Test% results in %Test% being echoed back).
Is there something more I should do?
Thanks,
Brian
Set WshShell = WScript.CreateObject("Wscr
Set WshUserEnv = WshShell.Environment ("USER")
WshUserEnv("Test") = "123"
When I login the user, the variable 'Test' appears in the user's list of variables in the 'MyComputer'->'Properties'
Is there something more I should do?
Thanks,
Brian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER