If you own a Land Rover, like me, you'll need a regular supply of parts! Many of us have "acquired" the Landrover EPC, on CD Rom.
This software usually requires you to set your computer clock to the 1st of Jan 2008 (or another date). This can be a pain - especially if you forget to set the clock back to normal after running the program.
So, as I work in IT, I figured it's time I gave something back to this forum, which has helped me on a number of occassions!
When you start the program (called a "script") it sets your computer clock to 01/01/2008 12:00hrs. It then starts Microcat. After you close Microcat - the script automatically resets your computer clock back to normal, and closes itself.
Oh - one other thing, the last action the script takes it to sync your PC clock with special "time servers" on the internet. If you don't want it to do this - open the script in a text editor - like "Notepad.exe", and follow the instructions in the last few lines in the script.
Any questions just post a reply,
Have fun!
------------------------------------------------------------
I would have preferred to provide this program, or "script", as an attachment in a ZIP file - but the forum rules are blocking the upload (which is fair enough!) So instead, if you want to use this, you'll have to do a bit of extra work! Bascially, copy/paste the text after the words "start of script", into a text editor like "notepad.exe". Then, in notepad, save the text file as "C:\MCLRE\Run-Microcat.vbs" (assumming that's where you have installed Microcat). The Script was written for Windows XP - but should work on all versions of Windows later than "Windows 2000". To run Notepad, just click "start", "run", then type "notepad.exe" - and click "ok".
In future, instead of running the normal shortcut for Microcat - run the script instead (double click it, create a shortcut to it, etc).
------------------------------------------------------------
Start of script (do not copy this line)
Option Explicit
'This script is designed to run the Land Rover EPC.
'The basic idea, is to set the system clock to 1st Jan 08, run the EPC, then restore the system clock after.
'Additionaly, you can re-sync your clock with an Internet NTP server..
Dim oFSO, oShell, sNowDate, sNowTime, dStartTime, dEndTime, dDuration, dRealStartTime
dim sAppPath, sEPCFileName
set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
sAppPath= Replace(WScript.ScriptFullName, WScript.ScriptName, "")
sEPCFileName="mclre.exe"
if not oFSO.FileExists(sAppPath & sEPCFileName) then
msgbox "Land Rover EPC not found at : " & sAppPath & sEPCFileName & vbcrlf & vbcrlf & "Ensure that the EPC is installed, and that you are running this script from the same Folder as the EPC.",16,"EPC not found"
wscript.quit
end if
'Capture current Date..
dRealStartTime=now()
'Set Date to 1st Jan 2008:
With oShell
.Run "%comspec% /c date 01/01/2008"
.Run "%comspec% /c time 12:00:00"
msgbox "System Date Changed to 01-Jan-2008", 64, "Clock Set:"
'Start a Stopwatch, to capture Duration (to be used to reset clock after EPC closed)
dStartTime=now()
'start the EPC here
.Run sAppPath & sEPCFileName,1,True 'Start EPC, and force this script to wait until EPC is closed before continuing...
'msgbox "simulate running EPC here..."
dEndTime=now()
dDuration=dEndTime-dStartTime
'Restore Date to when this script started:
sNowDate = FormatDateTime (dRealStartTime + dDuration, vbShortDate)
sNowTime = FormatDateTime (dRealStartTime + dDuration, vbLongTime)
sNowTime = replace(sNowTime,":",".")
.Run "%comspec% /c date " & sNowDate
.Run "%comspec% /c time " & sNowTime
End With
msgbox "Date Restored to " & sNowDate & " " & sNowTime & ", EPC ran for " & FormatDateTime (dDuration, vbLongTime) & " seconds.."
'Update System Clock wth Internet Time Servers.
'Note: software firewalls, like ZoneAlarm may block Internet Time service lookups
'see: http://www.digitalspy.co.uk/forums/showthread.php?p=18540203
'To ignore this next section, simply put an ' before each line...
With oShell
.Run "%comspec% /c w32tm /config /syncfromflags:manual /manualpeerlist:pool.ntp.org"',tick.usno.navy.mil,tock.usno.navy.mil,time.windows.com"
.Run "%comspec% /c w32tm /config /update"
.Run "%comspec% /c w32tm /resync /nowait"
End With
msgbox "System Date re-sync'd with Internet NTP servers - it may take a few seconds for your clock to be updated (assuming your firewall permits Time Server updates (TCP port 123)."
'end of copy/paste here