Using a script that reads registry-- HELP?

Sub object_OnTimer123

od = now()
Set oShell = CreateObject("WScript.Shell")
atb = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\" & "Control\TimeZoneInformation\ActiveTimeBias"
offsetMin = oShell.RegRead(atb)
nd = dateadd("n", offsetMin, od)

object.text= "Now: " & (od) & " GMT: " & (nd)

End sub

The script above reads the registry and finds the difference between system time and GreenwichMeanTime. If you put it into a text object you'll see the information it provides. It is very efficient in setting different time zones for my latest widget here: --LINK--

As you may read in the thread in the link, one user had some security issues when using my widget.

I pretty sure the aforementioned code may be the source of the problem but I'm not sure how. Does anyone with experience and better knowledge of scripting know if the code above can cause such security concerns? If so, how can I fix it? Thanks.
6,805 views 3 replies
Reply #1 Top
I've heard of different security apps preventing registry reading and writing. If I were placing bets I'd start checking there.
Reply #2 Top
If it's on a computer that's administered by someone else & the user is limited access. Then the Local Machine settings obviously can't be written. Have you tried to see if the User settings allow time related registry entries or not?
Reply #3 Top
Thanks for the replies.

I've tested the object on a computer that had the same security application as the one the user had problems with. There's no way to stop the security pop up from happening but I've modified the script so that it only causes a popup on start up. If you click 'allow entire script to run' then the pop up goes away and will not bother you again until the next time you load up the widget.


If it's on a computer that's administered by someone else & the user is limited access. Then the Local Machine settings obviously can't be written. Have you tried to see if the User settings allow time related registry entries or not?


I never thought about non-administrator accounts not being able to access the registry. That's something I'll have to look into.