Solved

change timezome using HTA

Posted on 2010-08-22
2
628 Views
Last Modified: 2012-06-21
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

0
Comment
Question by:whowasthat
  • 2
2 Comments
 
LVL 12

Expert Comment

by:Daz_1234
ID: 33499044
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

0
 
LVL 12

Accepted Solution

by:
Daz_1234 earned 500 total points
ID: 33499091
Just another query - are you sure it should be:

control.exe timedate.cpl,,/Z Central Time Zone


... and not:

control.exe timedate.cpl,,/Z Central Standard Time

?


Daz.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now