Apologies if I overlooked this problem in another thread, but I was unable to find it (here or really anywhere on the internet).
In Windows (XP), I have the following global environment variable which I set by right-clicking My Computer, then choosing Properties > Advanced > Environment Variables:
CUSTOM_HOME = c:\some\folder\path
How do I interpolate this into an execution within a batch file? I need to “append” subfolder\program.exe to this path so that I get c:\some\folder\path\subfolder\program.exe in the batch file. I try something like
%CUSTOM_HOME%\subfolder\program.exe
but when I execute the batch file, the output just shows
> \subfolder\program.exe
> The system cannot find the path specified.
What’s the correct syntax so the full path to the .exe will be correct?
That is the correct syntax, but you will need to add quotes around the whole thing in case the custom_home path contains spaces.
If it isn’t being found, then that means the global env variable is either misspelled or not available. You can test this at the command line with
SET CUSTOM_HOME.