Computing.Net > Forums > Windows Server 2003 > Syntax error on cmd file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Syntax error on cmd file

Reply to Message Icon

Name: Kuthy
Date: June 13, 2007 at 22:29:31 Pacific
OS: Windows Server 2003 R2
CPU/Ram: 3.4Ghz - 1024MB
Product: HP
Comment:

I have created a simple batch script that moves a file to a certain directory. When it moves the file it changes the name of the file to reflect the current date and time. This was working 100% until this error came up: The syntax of the command is incorrect. (Windows Server 2003 standard ed)

Here is my code:
@echo off
set drive=S:\Logs
set dateNtime="%date:~0,2%%date:~3,2%%date:~6,6%_%time:~0,2%%time:~3,2%"
echo ## Backing up Logs
move "C:\DB\Logs\vumlogs.bak" "%drive%\vumlogs%dateNtime%.bak"
echo.
echo.
pause

Please could someone assist as to why that error is coming up. it was working OK ??
Tks in advance.


Kuthy



Sponsored Link
Ads by Google

Response Number 1
Name: jefro
Date: June 18, 2007 at 21:05:58 Pacific
Reply:

A batch file can usually be typed in one line at a time from the command prompt to discover the line that is bad.

I'd say look at the output from set to start.

I read it wrong and answer it wrong too. So get off my case you goober.


0
Reply to Message Icon

Related Posts

See More


Files & Settings Tran... Server Shares and Permiss...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Server 2003 Forum Home


Sponsored links

Ads by Google


Results for: Syntax error on cmd file

Error when Deleting Files www.computing.net/answers/windows-2003/error-when-deleting-files/5192.html

IE password, invalid syntax error www.computing.net/answers/windows-2003/ie-password-invalid-syntax-error/1604.html

MAC 2GB limt on Win2003 file server www.computing.net/answers/windows-2003/mac-2gb-limt-on-win2003-file-server/6965.html