Hi guys
I want to add a line into my batch file that will read the current date on the pc and then change it back by 5 days exactly.
Does anyone have any ideas on how to do this ?
Thanks
Printable View
Hi guys
I want to add a line into my batch file that will read the current date on the pc and then change it back by 5 days exactly.
Does anyone have any ideas on how to do this ?
Thanks
Hi toon; This would be extremely difficult, if not impossible. The first problem is, there's no good way to do math in a batch file. Now, you could do it with by using the batch file to run a small BASIC program, but even then, the BASIC program would take some doing.
Suppose it was March 2, in a leap year. You'ld have to read today's date, and the month, and the year, and detemine whether the month before was 28, 29, 30, or 31 days. You'ld have to calculate the year to see if it was a leap year or not.
A bit more than meets the eye. :p
I could do it if you want, but its not a very elegant solution.
thanks for the reply Mr Dex
I'm actually just going to change the date manually... for the sake of 5seconds!
thanks a million
I think that's best... :)Quote:
Originally Posted by ToonLoon
You could probably do it with this:
http://www.merlyn.demon.co.uk/programs/nowminus.exe
With these instructions:
http://www.merlyn.demon.co.uk/programs/nowminus.txt
but as Dexahol says, messy...
Firstly curious as to why you want you PC 5 days behind the current date.
Secondly you should only need to do this once unless your PCs date is getting synconised from a network or on the www somewhere.
ie if You went in and changed it today to 29.03.2005 and then you boot up tomorrow and you PC says 30.03.2005 and you change it back 5 days it will be 25.03.2005 and so on......