date format

October 3, 2011 at 06:30:40
Specs: Windows 7
But how do you get the date in YY format rather than in yyyy format??
my script is as follows.

FOR /F "tokens=1,2 delims=:" %%A IN ('TIME/T') DO SET Now=%%A-%%B
set source=C:\Users\282113\Documents\Rami\Kaka\xxx.txt
set destination=C:\Users\282113\Documents\Rami\Kaka
For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do (
Set Month=%%A
Set Day=%%B
Set Year=%%C

)

move %source% "%destination%\C%date:~4,2%%date:~7,2%%date:~10,-2%.txt.txt"


kindly help...its urgent


See More: date format

Report •

#1
October 8, 2011 at 08:29:13
@echo off
setlocal enabledelayedexpansion
FOR /F "tokens=1,2 delims=:" %%A IN ('TIME/T') DO SET Now=%%A-%%B
set source=C:\Users\282113\Documents\Rami\Kaka\xxx.txt
set destination=C:\Users\282113\Documents\Rami\Kaka
For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do (
Set Month=%%A
Set Day=%%B
Set Year=%%C
Set Year=!Year:~2,3!
)

move %source% "%destination%\C%date:~4,2%%date:~7,2%%date:~10,-2%.txt.txt"


Report •

#2
October 11, 2011 at 00:05:24
That worked...
thanks....!!


Report •
Related Solutions


Ask Question