sophos vb script to get update date and time

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
doodleman99
Posts: 38
Joined: Tue Sep 02, 2008 5:45 am

sophos vb script to get update date and time

Post by doodleman99 »

Hey guys,
i'm being a little stupid here - i have a really simple vbs script that translates the hex key of a registry key to a regular date format and i'd like to run a HM test based on the result/output.
if i save the file as a .vbs it runs fine but i'm being think when it comes to adding it as a shell script

the code is:

Code: Select all

Dim tZ, uKey, shell, lastUp
dim dateValue
tZ = 0 'time relative to GMT
uKey ="HKLM\Software\Wow6432Node\sophos\AutoUpdate\UpdateStatus\LastUpdateTime"
Set shell =CreateObject("WScript.Shell")
lastUp = shell.RegRead (uKey)
dateValue = DateAdd ("h",tZ,(DateAdd("s",lastUp,"01/01/1970 00:00:00")))
Wscript.Echo(dateValue)
can you help un-dumb me please?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Any "Shell Script" script should return reply in the following format:
ScriptRes:<Status>:<Reply>
E.g.:
ScriptRes:Ok:10
ScriptRes:Bad:3

Your script should look like the following:
const statusUnknown = "scriptRes:Unknown:"
const statusOk = "scriptRes:Ok:"
const statusBad = "scriptRes:Bad:"

Dim tZ, uKey, shell, lastUp
dim dateValue
tZ = 0 'time relative to GMT
uKey ="HKLM\Software\Wow6432Node\sophos\AutoUpdate\UpdateStatus\LastUpdateTime"
Set shell =CreateObject("WScript.Shell")
lastUp = shell.RegRead (uKey)
dateValue = DateAdd ("h",tZ,(DateAdd("s",lastUp,"01/01/1970 00:00:00")))

WScript.StdOut.Write statusOk & dateValue
doodleman99
Posts: 38
Joined: Tue Sep 02, 2008 5:45 am

Post by doodleman99 »

i knew i was being stupid :D
thanks for your super fast response (as always)
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome.
Post Reply