Saved Bookmarks
| 1. |
Solve : add date to file that is previous saturday?? |
|
Answer» I would like to rename a file, but I don't want it to have today's DATE, I want the date to be WHATEVER the previous saturday was. For example, I want the file to have the name file.011307 which was Saturday's date. How can I do this? Thanks.Quote I would like to rename a file, but I don't want it to have today's date, I want the date to be whatever the previous saturday was. For example, I want the file to have the name file.011307 which was Saturday's date. How can I do this? Thanks. Check your message box here. luvsun27, Try this: [edit]@echo off CALL:jdate jd SET /a jd=jd/7*7+5 CALL:jdate2date jd y m d echo.file.%m%%d%%y:~2% pause GOTO:EOF :jdate ... :jdate2date ... [/edit] Get the :jdate function from here http://www.dostips.com/DtCodeCmdLib.php#jdate Get the :jdate2date function from here http://www.dostips.com/DtCodeCmdLib.php#jdate2date DOS IT HELP? Why not do it the easy way. RESET the date in the computers clock. Rename the file. Set the clock to correct date.Quote Why not do it the easy way. Reset the date in the computers clock. Rename the file. Set the clock to correct date. You're right. Until I read your post, I was automatically thinking that it was a task that NEEDED to be repeated periodically, and that is not what the original poster said. I was prepared to swat a fly with an ELEPHANT gun. Sorry....I got someone to help me with a vb script to do this. And yes...this needs to be done weekly, so it's not feasible to change the clock all the time. I appreciate the help! |
|