mkdir help

  • Thread starter Philip Saunders
  • 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
 
B

billious

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
 
T

Timo Salmi

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
 
J

januszml

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%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top