Jump to content
Sign in to follow this  
tommy13061980

Change windows time

Recommended Posts

tommy13061980

Hello, I am quitte new with AutoIt.

One thing i just can not solve.

My program needs to set the windows clock to a specific time.

Example:

Script -> Change windows clock to 07:30

I found this: _Date_Time_SetTimeZoneInformation

But it is a little bit difficult for me to understand.

I only need to change the visible clock time in the bottom left corner.

Any help will be appreciated very much.

Many thanks in advance

Share this post


Link to post
Share on other sites
water

To set the current local time of your PC use: _Date_Time_SetLocalTime().

In the help file you'll find an example.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tommy13061980

Thank you very much Mass Spammer.

And also for so fast answering.

It seems to work perfect on XP.

I still need to test on VISTA.

Share this post


Link to post
Share on other sites
Fire

Hi.

Another way for change windows time :

NOTE: You need administrative privilegies for this operation.

#RequireAdmin
RunWait("cmd.exe /c " & "time 07:30",@ScriptDir,@SW_HIDE)

[size="5"] [/size]

Share this post


Link to post
Share on other sites
tommy13061980

Hi, Thanx both of you.

But, as i espected, VISTA sais, can not change windows time. User has not the right privileges.

is thwere any way i can get arround that.

Another option is to change the creation date of a file.

But the file has a crc check.

Share this post


Link to post
Share on other sites
water

The help file says:

"Function _Date_Time_SetLocalTimeThe SetLocalTime function enables the SE_SYSTEMTIME_NAME privilege before changing the local time."

If you don't have this privilege then there is no way to change the time.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×