Sign in to follow this  
Followers 0
Guest JGBRUUN

How to select a particular TAB in timedate.cpl?

5 posts in this topic

I have just yesterday started using this tool.

After a great deal of beginners problems, I have come to the end of my wits with two particular problems:

1)

Hos do I select a specific TAB (e.g. TimeZone in "Date and Time Properties")

2)

How do I check where I am, in an application like GPEDIT.MSC?

Example:

I want to be able to ensure that I am actually on the "Local Computer Policy\Computer Configuration\Administrative Templates\System\User Profiles" folder before continuing...

The Spy feature shows the information, but I seem to be unable to use this information to my advantage.

Quite simple problems actually, but as I said, I'm a newbee. I could not find any other threads that discussed these two topics, by using the search function on this site.

Hope someone can help, as I am going crazy here.

Thanks,

Jorgen Bruun

Nordea Bank

Luxembourg

Share this post


Link to post
Share on other sites



Hi,

Thanks for the suggestion, it worked, except for one detail I don't understand.

If I write the command including the title of the Window, it doesn't react.

ControlCommand ( "Date and Time Properties", "", "SysTabControl321", "TabRight", "")

If I leave the title blank, it works. However this seems a bit unsafe, as I do not know what window it is working on...

ControlCommand ( "", "", "SysTabControl321", "TabRight", "")

As for the ControlGetFocus command, what does it do??

It's nice, I'm getting there, even though I don't really know how.

:D

Share this post


Link to post
Share on other sites

Here are some code samples tested on Windows XP.

This might look pretty complicated, so here's some quick info on this code:

1) Open the Date/Time properties window. Essentially run the console command cmd /c control.exe "c:\windows\system32\timedate.cpl" watching out for quotation marks and spaces--and HIDE the command prompt.

2) Wait for the window to appear (and be active)

3) Jump to the second tab

Run(@ComSpec & ' /c control.exe ' & '"' & @SystemDir & '\timedate.cpl"' , "", @SW_HIDE)
$title = "Date and Time Properties"
WinWaitActive($title)
ControlCommand($title,"","SysTabControl321", "TabRight", "")

THIS CODE IS NOT COMPLETE

but it should give you ideas...

; meaning that cursor focus starts out at "Local Computer Policy"
Run(@ComSpec & ' /c gpedit.msc', "", @SW_HIDE)
WinWaitActive("Group Policy")
Send("c")
While Not WinGetText("Group Policy") <> "Local Computer Policy\Computer Configuration"
   sleep(100)
Wend
Send("{Down}")
Send("a")
While Not WinGetText("Group Policy") <> "Local Computer Policy\Computer Configuration\Administrative Templates"
   sleep(100)
Wend

Send("{Right}")
Send("s")

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thanks a Mill.

Worked fine.

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  
Followers 0