June 2, 2009 at 1:15 pm
Transferring data exports to a backup folder. Want to create a backup folder based on current date. For the life of me I cannot get this to work:
REM Transfer of nightly BFS data export to a dated folder
REM Create a backup folder with today's date.
@echo on
c:
cd c:\BFS_Backup
Set foldername = %date:~10,4%-%date:~4,2%-%date:~7,2%
mkdir %foldername%
REM Move nighlty BFS data export text files to dated folder
MOVE c:\BFS_Backup\*.txt c:\BFS_Backup\%foldername%
It bombs at mkdir. It states The syntax of the command is incorrect. It doesn't make the folder. I can make any type of directory folders no problem.
I am overlooking something..I know it
thanks
June 2, 2009 at 2:04 pm
The issue is you are missing the quotes...
edit your statment to this:
C:
CD "C:\BFS_Backup"
MKDIR "[/color]%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%"
-
June 3, 2009 at 6:58 am
Jason greatly appreciated I was playing with this for over 2 hours yesterday...
Now it works...
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply