me,myself,english and programming..

Change system date using command line in windows

This is very useful when you need to change your system date before open up some of your application that already expired.

@Echo Off
REM ** Must be run as System Admin Priviledge

REM Store systems current time into BEFOREDATE var as mm-dd-yy
SET BEFOREDATE=%date:~4,2%-%date:~7,2%-%date:~10,4%

REM Set the below date to date you wish to roll your system date back to
DATE 04-11-11

SET now=%date%
echo Date change to - %now%

REM First param of START command needs empty double quotes
REM Second param of Start command should be absolute path to application
REM IE "C:\Program Files\directory\filename.exe"

START "" "ThisIsYourProgramName"

REM Cause a delay to allow application to load

PING -n 10 127.0.0.1 > NUL 2>&1

REM Set system date back to current date
DATE %BEFOREDATE%

SET now=%date%
echo Date Now - %now%

 

testDate

Till then..adioss

Post a Comment