Your batch does not work as designed
This can be due to configuration
Before troubleshooting you should check the command line extensions. You can check this parameter in the registry HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtentions and check if they are enabled 1 or disabled 0.
Change this value and check if your script runs properly. You can also use the /E:ON or /E:OFF parameter under Windows XP or /X or /Y under windows NT 4.0.
About the Author
Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience, including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform.