Link to home
Start Free TrialLog in
Avatar of Nevada6372
Nevada6372

asked on

How to identify the path in batch file - %Variable%

I'm working on a 2003 Windows Server, and one of the batch files that previously worked but no longer does after an upgrade, is a variable that I cannot figure out.

The batch file reads as such:
call "%SoftwareDir%\Utils\change.bat" "%1" "%2"
but I'll receive the following, "The system cannot find the path specified."
I know the path of the directories it is supposed to be pulling from and if I edit the batch file with the exact path such as:
call "D:\Software\Utils\change.bat" "%1" "%2"
the script will run without error.

What I'm trying to figure out is what the %SoftwareDir% refers to, and where it is set.  I thought it would be listed under the Set command, but after seeing the output from Set, I don't see anything referencing "SoftwareDir."  Anybody know where I can find what path this variable is referring to?  Thanks.

Eric
SOLUTION
Avatar of tmwsiy
tmwsiy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To set this at the system level, right-click on My Computer / Properties / Advanced system settings.  Then click on the Environment Variables button and create a new System variable called SoftwareDir with the appropriate path value.
... after that you will need to close and re-open your command prompt.  Then when you run the SET command you should see it, and it will work in the script.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial