Link to home
Start Free TrialLog in
Avatar of whowasthat
whowasthatFlag for Canada

asked on

change timezome using HTA

hi,
   im am trying to change the computers timezone using an HTA app.  
i have a drop down list and when the user picks the location it runs a IF statement in a VBscript.  when it gets executed there is an error that it can not find the location.  im confused because it works in a CMD prompt if i cut and paste it.

can anyone please help
if user.Timezone.value = "Central Standard Time" then
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "control.exe timedate.cpl,,/Z Central Time Zone"
End if

Open in new window

Avatar of Darren Collins
Darren Collins
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,

What about the following run method instead?  It will run silently.

Regards,
Daz.
If user.Timezone.value = "Central Standard Time" Then
    Set wshShell = CreateObject("WScript.Shell")
    wshShell.Run "control.exe timedate.cpl,,/Z Central Time Zone", 0, True
End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Darren Collins
Darren Collins
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial