I need to be able to run multiple commands in the same cmd session. What I mean is, I need for the commands to remember the previous command, so I believe it has to run in the same cmd session. I also don't want to have to create a batch file and have the VBScript run the batch file. That would be easy. I want all of the commands to be in the VBScript.
Here is an example of what I am trying to do (not my real code):
Set WshShell = CreateObject("WScript.Shell"
WshShell.Run "cmd /c SET ENVVAR = chickety", 1, TRUE
WshShell.Run "cmd /c SET ENVVAR >C:\example.txt", 1, TRUE
Now if I did these commands in a regular cmd window outside of VBScript, I would get ENVVAR = chickety as the answer to the second command. But in VBScript, I get nothing back. How do I get it to remember the previous command. I tried using cmd /k to no avail, I also tried 0, TRUE. I am obviously a beginner at this, but I need your help. What can I do? PLEASE HELP, this is driving me crazy!
Here is an example of what I am trying to do (not my real code):
Set WshShell = CreateObject("WScript.Shell"
WshShell.Run "cmd /c SET ENVVAR = chickety", 1, TRUE
WshShell.Run "cmd /c SET ENVVAR >C:\example.txt", 1, TRUE
Now if I did these commands in a regular cmd window outside of VBScript, I would get ENVVAR = chickety as the answer to the second command. But in VBScript, I get nothing back. How do I get it to remember the previous command. I tried using cmd /k to no avail, I also tried 0, TRUE. I am obviously a beginner at this, but I need your help. What can I do? PLEASE HELP, this is driving me crazy!