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\chang e.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
The batch file reads as such:
call "%SoftwareDir%\Utils\chang
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.