TheRiddl3r
Active Member
- Joined
- May 22, 2007
- Messages
- 50
Im looking for a DOS file that will copy a directory into a new folder that is named as the current date in the following format : 4 May 2008
Anyone?
Anyone?
Im looking for a DOS file that will copy a directory into a new folder that is named as the current date in the following format : 4 May 2008
Anyone?
cd "C:\documents and settings\TheRiddl3r\my documents"
how does dos work with spaces? Or really long folder names (13 odd characters)
twiddle a bit with this
rem Make Directory With Name consisting of Date
for /f "tokens=1-3 delims=/- " %%a in ('date /t') do set XDate=%%a-%%b-%%c
echo %XDate%
md "%XDate%"
change the %%a %%b %%c order in the second line to change the date format, but bear in mind it uses the date format of the machine it is run on. so if you set it correct on a s.a. machine adn then run it on a US machine the day and month will swop around. the third line is not necessary, just gives you a bit of output so you can see the expteced format....i'd add a REM to the fourth line, fiddle with the a, b and c order till it displays correctly then REM out the third line and make the fourth line active by removing the REM.
for /f "tokens=1-3 delims=/- " %%a in ('date /t') do set XDate=%%c-%%b-%%a
echo %XDate%
cd "C:\documents and settings\Matthew\my documents\FlashDisk Backup\"
md "%XDate%"
cd "C:\documents and settings\Matthew\my documents\FlashDisk Backup\%XDate%"
xcopy e:\* /s