Save system date and wind clock back 10 years

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ed in aus
Posts: 1
Joined: 24 Mar 2009 20:43

Save system date and wind clock back 10 years

#1 Post by ed in aus » 24 Mar 2009 20:48

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

RElliott63
Expert
Posts: 80
Joined: 04 Feb 2009 10:03

#2 Post by RElliott63 » 25 Mar 2009 07:25

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

Post Reply