Page 1 of 1

Save system date and wind clock back 10 years

Posted: 24 Mar 2009 20:48
by ed in aus
Hi,

Batch 1
What I am trying to do is store the current date in a temp file (that can be called in another batch later) and wind the current system time back 10 years.

Batch 2
Use the temp file created previously to restore the current date...
Delete temp file

any one know what I need to do, fairly new to bat files...

Using Vista so UAC is turned off for this.

Date format DD/MM/YYYY (Australian)
and time is not in 24 hours time

Have been researching but can't even figure out where to start

Posted: 25 Mar 2009 07:25
by RElliott63
To save the Current Date into a Temp File:

Code: Select all

   Echo Date %Date% > \Temp\ResetDate.bat


To set the date:

Replace the dd/mm/yyyy with the date desired
Replace the HH:MM:SS with the time desired

Code: Select all

   Date dd/mm/yyyy
   Time HH:MM:SS


To return the system to the date saved:

Code: Select all

Call \Temp\ResetDate.bat


-Rick