I'm writing a simple batch script on Windows 7 to add some some environmental file paths. Trouble is, my set path command is failing because of spaces in the existing path:
SET PATH=C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;%Path%
This fails with '\ Microsoft cannot be found' which refers I think to this in the existing %path% variable :-
c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
Is there a simple solution to this?
Update: Turns out the issue lies with a surrounding IF statement.This script throw up the mentioned error message:
IF "TEST" == "TEST" (
ECHO Using TEST settings on %COMPUTERNAME%
SET PATH="C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;%Path%"
SET GDRIVE= (removed path)
)
But if I remove the IF statement, it works fine:
ECHO Using TEST settings on %COMPUTERNAME%
SET PATH="C:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;%Path%"
SET GDRIVE= (removed path)
Does anyone know why an IF statement is causing the SET PATH to fail?