Solved

change timezome using HTA

Posted on 2010-08-22
2
631 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

929 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

12 Experts available now in Live!

Get 1:1 Help Now