The environment variable would be alive as long as the Shell is alive--but it's
limited to that shell and its children.
So if you need to run a .bat file that needs an environment variable, you could
shell to a different .bat file that sets the environment variable and then runs
the .bat file that you need to run.
But if you want to change the environment variable globally, it's a different
story.
Win95 came with command called WinSet that did this. But I don't see it in
WinXP (at least in a normal install).
But you could search google looking for alternatives.
I've never used this, but it looks interesting:
http://www.codeguru.com/cpp/w-p/win3...le.php/c10849/
ChristopherL wrote:
>
> I modified test5 to make the shell command wait till the command
> completes, but was rewarded with the same results, nothing printed!
> Chris
>
> (5) The following did not work either:
>
> Sub test5()
>
> Dim ev_result As String
>
> ev_result = Shell("cmd /c set chris=""1 2 3""")
> ev_result = Environ("chris")
>
> Debug.Print ev_result '--->Prints Nothing!
>
> End Sub
--
Dave Peterson