NOOB needs help
Posted: 09 Jun 2011 03:16
Hi All.
I'm writing a batch file that will rename a log file to include the date in the filename then move or copy the log file to a network location. So far the rename is going fine although the date is in ddmmyyyy format and I would prefer yyyymmdd format but the file is not moving. Here it is so far (The pause is just there in case the file rename takes a moment):
Set FileDate=%date:/=%
ren c:\batchtests\backup.txt %FileDate%backup.txt
PING 1.1.1.1 -n 1 -w 10000 >NUL
xcopy c:\batchtests\*.txt to "\\servername\x:\!folder\"
Is the ! in the folder name causing problems? Any help is greatly appreciated.
I'm writing a batch file that will rename a log file to include the date in the filename then move or copy the log file to a network location. So far the rename is going fine although the date is in ddmmyyyy format and I would prefer yyyymmdd format but the file is not moving. Here it is so far (The pause is just there in case the file rename takes a moment):
Set FileDate=%date:/=%
ren c:\batchtests\backup.txt %FileDate%backup.txt
PING 1.1.1.1 -n 1 -w 10000 >NUL
xcopy c:\batchtests\*.txt to "\\servername\x:\!folder\"
Is the ! in the folder name causing problems? Any help is greatly appreciated.