mkdir help

  • Thread starter Thread starter Philip Saunders
  • Start date Start date
P

Philip Saunders

Hi,

Is there any way to make a directory but for it to have the current date as
part of the name

i.e MKDIR LAPTOP_(DATE)

Basically I backup my laptop to an external drive and want it to create a
folder called laptop with the current date.

Thanks in advance for any help.

Phil
 
Philip Saunders said:
Hi,

Is there any way to make a directory but for it to have the current date
as part of the name

i.e MKDIR LAPTOP_(DATE)

Basically I backup my laptop to an external drive and want it to create a
folder called laptop with the current date.

Thanks in advance for any help.

Phil

This is a FAQ in alt.msdos.batch.nt.

Look for Timo Salmi's "Useful NT/2000/XP script tricks and tips" last posted
there on Nov. 9th
 
This is a FAQ in alt.msdos.batch.nt.
Look for Timo Salmi's "Useful NT/2000/XP script tricks and tips" last posted
there on Nov. 9th

Thanks. Below is the path:
ftp://garbo.uwasa.fi/pc/link/tscmd.zip

All the best, Timo
 
Philip said:
Hi,

Is there any way to make a directory but for it to have the current date as
part of the name

i.e MKDIR LAPTOP_(DATE)

Basically I backup my laptop to an external drive and want it to create a
folder called laptop with the current date.

Thanks in advance for any help.

Phil


This may help you:

for %%i in (%date:/=-%) do set d=%%i
for /f "tokens=*" %%j in ('time /t') do set t=%%j
if "%t:~1,1%"==":" set t=0%t%
set timestr=%d%-%t:~0,2%%t:~3,2%%t:~6,4%
md Laptop_%timestr%
 
Back
Top