Posts: 18
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
Thanks,
It was not quite what I needed as it also needs to run on win98. But your answer got me thinking about what is really going on, so I found another way of doing it, for anyone with a similar problem I have included an example:
Set EnvObject = WshShell.Environment Original=EnvObject.Item("Tmp") EnvObject.Item("Tmp") = "c:\VbTmp" WScript.Echo "Tmp dir changed from " & Original & " To " & EnvObject.Item("Tmp") EnvObject.Item("MyVar") = "Something" WScript.Echo "MyVar created, value : " & EnvObject.Item("MyVar")
Posts: 16
Score: 0
Joined: 6/4/2001
From: USA
Status: offline
I believe this only works in-process. It is not a permanent change. Run it, then go to a command prompt and type 'set'. On Win2K (don't know about 9x) it remained in its original state. The description for the .item property states it 'returns a specified item from a collection'.