Jump to content

CHange date of the sytem - TAB management


webrod
 Share

Recommended Posts

Hi,

the internal battery of my eeePC is dead, and it cannot be changed as far as I understand.

so it looses the datetime each time the PC is switched off....

I first tried a command line that I found on the web, but it was saying that it cannot change the date time, because the time difference was too high!!

It was a command line that was synchronizing the time with a online server.

But when I do it manually, it works (by clicking beside the clock with windows seven).

So now I use autoit.

I did a script which works fine, but I have to change the TAB.

To change the TAB, I use

Send("{TAB}"}

It works welll, unfortunatelly, I want to automate this script when I logon on the computer, so it could happen that I press some keys.

If I press a key while the script is running, the "date and time" window could loose the focus, so the "send " command will be received by another window...

Therefore I would like to know if there is a means to go to another tab with another means, like with ControlClick, which is great because it can work without the focus!!

any idea?

Here is my script:

Run("RunDll32.exe shell32.dll,Control_RunDLL

WinWaitActive("Date et heure")

ControlClick("Date et heure", "", "SysTabCon

Send("{TAB 7}")

Send("{RIGHT 2}");

Send("!M");

WinWaitActive("Paramètres d’heure Internet",

Send("!M");

WinWaitActive("Paramètres d’heure Internet",

ControlClick("Paramètres d’heure Internet",

ControlClick("Date et heure", "", "Button2")

I would like to replace the one in bold.

The Send("!M"), I know already how to replace it.

Thanks a lot.

Rod

PS: BTW if you know another means to set the date, or how to improve the script, please let me know :-)

Link to comment
Share on other sites

You could do something like this:

Global $Time = InputBox("Enter the time", "Please enter the time")
Global $Date = InputBox("Enter the Date", "Please enter the date")
Run(@ComSpec & " /c Time " & $Time, "", @SW_HIDE)
Run(@ComSpec & " /c Date " & $Date, "", @SW_HIDE)

Which will prompt you to enter a date and time in the input boxes and then run the appropriate command line command to set the date and time. You will need to enter the date in the format your computer is set to, mine is set to "yy-mm-dd". Time is set using the 24 hour clock format.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I was an electronics technician for nearly 20 years, and without the proper tools and training, I wouldn't even attempt to unsolder a part from a motherboard in a desktop, and definitely wouldn't touch a laptop. Unless the battery is one of the button batteries (a CR2032 or similar) don't bother trying this, it's extremely hard to unsolder one from a motherboard. Most motherboards are 4+ layers and you can EASILY destroy the board with even a 15 watt soldering iron.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...