Solved

change timezome using HTA

Posted on 2010-08-22
2
642 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 13

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 13

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Tag Manager - Add Trigger Using Div class 22 61
Debugging Html 8 32
Excel VBA API Loop Query Return results in excel 4 38
system default settings 4 25
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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)

733 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