G
Guest
Hi
I would like to copy and rename a file with the system date (Window 2000 Professional OS) as the filename by using the FOR scripting code in a batch file
Here is my code
copy E:\tv63_share\loncprod.prn E:\tv63_share\????????2.pr
for /f "tokens=2-4 delims=/" %%a in ('DATE /T') do set Date=%%a%%b%%
E
cd tv63_shar
ren loncprod2.prn %Date
However, the FOR code used in the parsing date, I got only the day and the year; th month is missing. If I change the tokens=1-4, then I got the "Wed 05192004" with "Wed" in front of it. How can I get only 05192004 without the Wed so that I can use %Date% as my filename. Please help. Thanks in advance
-Gordon Chiu
I would like to copy and rename a file with the system date (Window 2000 Professional OS) as the filename by using the FOR scripting code in a batch file
Here is my code
copy E:\tv63_share\loncprod.prn E:\tv63_share\????????2.pr
for /f "tokens=2-4 delims=/" %%a in ('DATE /T') do set Date=%%a%%b%%
E
cd tv63_shar
ren loncprod2.prn %Date
However, the FOR code used in the parsing date, I got only the day and the year; th month is missing. If I change the tokens=1-4, then I got the "Wed 05192004" with "Wed" in front of it. How can I get only 05192004 without the Wed so that I can use %Date% as my filename. Please help. Thanks in advance
-Gordon Chiu