When I run the following command in batch...
set PATH='C:UsersDEBDownloads10.1.1.0.4' cd !PATH!
I get the error "The file name, directory name, or volume label syntax is incorrect"
Update: Some solutions worked for me.
PATH
as a variable name"myPATH=C:UsersDEB DASDownloads10.1.1.0.4"
In my case, if I run the batch file using cmd and the batch file path is incorrect, this error will show up, like
users>E:\TEST"E:\TEST.bat
Error,users>E:\TEST.bat
worked. After checking my path, it was fixed.Single quotes don't represent strings, they make it start with:
李>'C:\
instead ofC:\
so%name%
is a common syntax for expanding variables. The!name!
syntax requires the commandsetlocal ENABLEDELAYEDEXPANSION, or
CMD /V:ON
Run command prompt.Don't use PATH as your name, it is the system name that contains the location of all executable programs. If you override it, random parts of the script will stop working. If you plan to change it, you need to do
set PATH=%PATH%;C:\Users\DEB\Downloads\10.1.1.0.4
to keep the current PATH contents and add something to the end .