Hi,
I am using windows-2008 machine.
In my batch script i have a condition like this,
if %BIT_FLAG% == 32-bit (
set PATH=C:\Program Files (x86)\Teradata\Client\%PKGVERSION%\bin
)
when i run this it is giving me an error..
\Teradata\Client\15.10\bin was unexpected at this time.
it seems it is giving me error due to having parenthesis.. how should i make it work?
giving error in path variable declaration
Moderator: DosItHelp
Re: giving error in path variable declaration
Code: Select all
if %BIT_FLAG% == 32-bit (
set "PATH=C:\Program Files (x86)\Teradata\Client\%PKGVERSION%\bin"
)
Re: giving error in path variable declaration
You may want to consider using a different variable name then PATH because PATH is already a system variable.
Re: giving error in path variable declaration
Or add it to the PATH variable, if that is the reason why you are using the PATH as it is intended.
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: giving error in path variable declaration
Alternatively, you could also escape the parentheses around x86 with the ^ character.
But using quotes like in Squashman's example is better because that way there is no possibility for extra spaces to be accidentally added to the end of the value.
Code: Select all
set PATH_VAR=C:\Program Files ^(x86^)\Teradata\Client\%PKGVERSION%\bin
But using quotes like in Squashman's example is better because that way there is no possibility for extra spaces to be accidentally added to the end of the value.