Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a folder based on the date

Status
Not open for further replies.

mannion

IS-IT--Management
Jun 24, 2002
73
GB
thanks to tip 4835

if you are trying to create folders based on the date as a name use this:-

@echo off
set $tok=1-3
for /f "tokens=1 delims=.:/-, " %%u in ('date /t') do set $d1=%%u
if "%$d1:~0,1%" GTR "9" set $tok=2-4
for /f "tokens=%$tok% delims=.:/-, " %%u in ('date /t') do (
for /f "skip=1 tokens=2-4 delims=/-,()." %%x in ('echo.^|date') do (
set %%x=%%u
set %%y=%%v
set %%z=%%w
set $d1=
set $tok=))
c:
md %yy%%mm%%dd%
pause

it works a beauty!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top