Solved

change timezome using HTA

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

688 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