Sportsguy,
The syntax you gave would work fine on 2000 but not NT4 as the date/time are not environment variables within NT4.
One caveat to this is you need a space after the / delimiter or it won't skip the day, thus:
for /f "tokens=2-4 delims=/ " %%i in ("%DATE%") do set d=%%k%%i%%j
your line for the time looks fine unaltered.
With NT4, as billious has commented you need to use TIME /T and DATE /T to output the date/time, surrounded by single quotes instead of doubles.
-Jherad
Main Topics
Browse All Topics





by: billiousPosted on 2002-11-09 at 21:13:03ID: 7429841
for /F "tokens=2,3,4 delims=/ " %%i in ('date/t') do set d=%%k%%i%%j
for /F "tokens=1,2,3 delims=:. " %%i in ('time/t') do set t=%%i%%j%%k
...
single quotes...
...Bill