towo2002
asked on
How to get specific characters in Windows Batch program?
Dear all experts,
I would like to know is it possible to convert current year to specific variable in a batch file, the format should be YY (i.e 08), please kindly advise
I would like to know is it possible to convert current year to specific variable in a batch file, the format should be YY (i.e 08), please kindly advise
ASKER
Hi Farhan,
Sorry about that it returns "ed" after running the script, please kindly advise
Sorry about that it returns "ed" after running the script, please kindly advise
open command prompt and type
echo %date%
post the results
echo %date%
post the results
ASKER
Dear devil,
It returns 05/21/2008 Wed. And I would like to return the year in "YY" format. (ie. return 08)
It returns 05/21/2008 Wed. And I would like to return the year in "YY" format. (ie. return 08)
@echo off
set yy=%date:~8,2%
echo %yy%
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you towo2002
Hope this help!
Farhan
Open in new window