Jump to content

Vista: Getting to User Profiles


Recommended Posts

Hi

I am testing a script in which I want to open the 'User Profiles' windows from the 'System Properties' Window, which is accessible by running

Rundll32.exe Shell32.dll,Control_RunDLL Sysdm.cpl,,3

My full code is:

AutoItSetOption ("WinWaitDelay", 750)

run("Rundll32.exe Shell32.dll,Control_RunDLL Sysdm.cpl,,3")

Do
     if WinGetState ("System Properties") = 7 then
          WinActivate ("System Properties")
     endif
Until WinGetState ("System Properties") = 15

WinActivate ("System Properties")
WinWaitActive("System Properties")

Send("!e")

I have inserted the Do loop, just incase the window is not active on load. After the loop I send an activate again and then wait for the window to become active. This all works fine.

The problem I have is that it's not recieving the Alt-e to open the User Profiles window. I have also tried sending Tabs, Enters etc - and all do not recieve on the window.

I have tested by inserting a msgbox before this to see if it was passing the winwaitactive - and it does.

Any ideas??

Thanks

EOTB

Link to comment
Share on other sites

Have you tried ControlSend instead?

BTW, what is that do loop doing for you? seams the Winactivate|WinWaitActive lines that follow it are doing the same thing to me.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

thanks for the replies.

I have updated the run to Run('control.exe sysdm.cpl,,3') and tested, but no difference.

I have also tried (instead of ControlSend) ControlClick("System Properties","","104") in place of the send. ID 104 is the button I want to click. This also doesn't work.

The do loop bits are really only for testing - if it works without it, I will remove.

It seems like the window doesn't want to recieve input after it is opened. Does anyone have vista that can confirm this?

Edited by EyeOfTheBeholder
Link to comment
Share on other sites

After you run the dialog just use WinWaitActive with the dialog's title and use simple Send('!e') because the dialog is now active and on the right tab window. If you can manually use ALT+E in the same window there shouldn't be problem doing so with Send function, after the window is active.

Link to comment
Share on other sites

After you run the dialog just use WinWaitActive with the dialog's title and use simple Send('!e') because the dialog is now active and on the right tab window. If you can manually use ALT+E in the same window there shouldn't be problem doing so with Send function, after the window is active.

Send("!e") was what I was orginally using. When the script stops at the point of showing the System Properties window, I can type ALT+e and it does open the window. Quite bizzare!

I am doing the same thing under WinXP and it works fine, so it may be a Vista thing. Before anyone asks, I do have UAC turned off for testing.

Edited by EyeOfTheBeholder
Link to comment
Share on other sites

If this three lines of code doesn't work it's for sure not AutoIt or bad code issues for sure:

Run('control.exe sysdm.cpl,,3')
WinWaitActive('System Properties')
Send('!e')
thanks for the post. I have tried the above script and .....

...it gets weird. I was running the script as a user with the Administrators Group and the above script does not work. I thought I would try it under the builtin Administrator account and it works fine - not sure why this would be. I have removed the Users group from the user, just incase there were permissions carry over, but still not working.

So it only works under Administrator, not a user.

Anyone else has similar issues with Autoit and Vista in this way

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...