Page 1 of 1 1
Topic Options
#197286 - 2010-01-06 12:03 PM how to set timezone in Windows 7?
Sam_B Offline
Getting the hang of it

Registered: 2005-10-25
Posts: 68
Loc: Bern, Switzerland
Hi everybody,

our company will migrate during this year to Windows 7. Now I'm testing my scripts regarding Windows 7 compatibility. During the stating of a XP machine, I set the correct timezone via the following function:

; ---------------------------------------------------------------------------------------------------
; Set date and time and timezone
; ---------------------------------------------------------------------------------------------------
Function SetDateAndTime()
$Ret = ShowStatus("Setting date, time and timezone...")
$Command = "RUNDLL32.EXE SHELL32.DLL,Control_RunDLL TIMEDATE.CPL,,/Z (GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"
Shell $command
If @error = 0
$SetDateAndTime = "Successfully set date and time"
Else
$SetDateAndTime = "Error setting correct date and time"
EndIf
EndFunction

Now this seems no longer working for Windows 7. I searched the board for a solution but didn't find anything... I'm sure somebody can give me a push into the right direction...

Many thanks

Samuel

Top
#197288 - 2010-01-06 12:24 PM Re: how to set timezone in Windows 7? [Re: Sam_B]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
Not sure if this is applicable, but it might give you some clues:

Setting the Time Zone using Windows PowerShel

Top
#197289 - 2010-01-06 12:27 PM Re: how to set timezone in Windows 7? [Re: Sam_B]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Since Vista, this requires elevated access. This link might provide some insight.. it's a Powershell example, but might be portable to kix.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#197290 - 2010-01-06 12:28 PM Re: how to set timezone in Windows 7? [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Clearly Brad has already had his coffee.. (and might not be typing in the dark, either) \:D

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#197293 - 2010-01-06 12:44 PM Re: how to set timezone in Windows 7? [Re: Glenn Barnas]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
I have the lights on and am drinking a diet dew. \:\)
Top
#197296 - 2010-01-06 01:13 PM Re: how to set timezone in Windows 7? [Re: BradV]
Sam_B Offline
Getting the hang of it

Registered: 2005-10-25
Posts: 68
Loc: Bern, Switzerland
To be honest, I am not very familiar (yet) with Windows Powershell to understand and translate the solution proposed there to KIX. Any other idea from the experts?
Top
#197297 - 2010-01-06 01:56 PM Re: how to set timezone in Windows 7? [Re: Sam_B]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
About to have my first coffee, so - no, none from me yet.. however - I do plan to look into the possibility of a generic "ElevateSecurityToken" type of UDF, which is needed for so many things in the post-vista environment. Once the security token is set correctly, it seems that most other things are fairly trivial.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1821 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.072 seconds in which 0.039 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org