Need to rename the generated file a, using ren a %date%.txt doesn't work. What is the syntax error? The purpose is to rename a generated every day to a text file named with the current day's time.
---------- Edited by willsort ----------
The solution is as follows:
ren a "%date%.txt" ——Floor 2
The file name generated by this method will contain the week count. To remove it depends on the date format of %date% in your system. If it is like "2005-10-15 Saturday", you can use
ren a "%date:~0,10%.txt" ——Floor 2
If it is like "Sat 2005-10-15", then you need to use
ren a "%date:~-10%.txt"
If it is other date formats, additional processing may be needed.
This is only a method that can be used in the NTVDM environment (DOS window) of the NT series platform. Under MSDOS6.22/7.10/Win9x, another solution is needed. Please search this forum.
---------- Edited by willsort ----------
[ Last edited by willsort on 2005-10-15 at 18:27 ]
---------- Edited by willsort ----------
The solution is as follows:
ren a "%date%.txt" ——Floor 2
The file name generated by this method will contain the week count. To remove it depends on the date format of %date% in your system. If it is like "2005-10-15 Saturday", you can use
ren a "%date:~0,10%.txt" ——Floor 2
If it is like "Sat 2005-10-15", then you need to use
ren a "%date:~-10%.txt"
If it is other date formats, additional processing may be needed.
This is only a method that can be used in the NTVDM environment (DOS window) of the NT series platform. Under MSDOS6.22/7.10/Win9x, another solution is needed. Please search this forum.
---------- Edited by willsort ----------
[ Last edited by willsort on 2005-10-15 at 18:27 ]
