Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Environment Variable with cscript and vbs file

Status
Not open for further replies.

danileite

Programmer
Jan 5, 2011
2
0
0
US
Hello all, I'm facing an issue when I try using a environment variable with cscript.
I have a cmd file that contains the follow command:

cscript c:\folder\file.vbs

My problem is: I cannot use a fixed drive.
So I created a environment variable where I set the drive value. This variable is Drive.
I tried to use this variable like this, but without success.

cscript %DRIVE%folder\file.vbs

run cscript "%DRIVE%folder\file.vbs"

run cmd /c cscript.exe "%DRIVE%folder\file.vbs"

Can someone help me with this?
 
Hey all, this issue was solved. This ran with success using the following command:

SET TEST = "cscript %DRIVE%folder\file.vbs"
%TEST%

Simple! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top