2 replies
by sean reed
According to "MS-DOS Batch File Programming 2nd Edition", chances are the best way would be to somehow save the output of DATE to a system variable. Then, once it's been saved, just issue an MD (or MKDIR) command specifieing whatever system variable you stored the date in.
For instance:
@echo off
date > %date%
md %date%
THEN your various xcopy commands.
by jbridges
This works for me.
:Begin
:: Extract the date and apply it to variables.
for /F "tokens=1-4 delims=/ " %%i in ('date /t') do (
set DayOfWeek=%%i
set Month=%%j
set Day=%%k
set Year=%%l
set Date=%%i %%j/%%k/%%l
)
rem scopyc:\hyperi~1\*.* E:\recover\cldate\Daily Backup /o /a /s
scopy c:\hyperi~1\*.* E:\recover\hyperbak\Daily /s
Exit
pause
This discussion is closed to new replies.
Trending IT Employment posts
Sort by Trending