Sign in to follow this  
Followers 0
hisbigego

Switching user accounts

6 posts in this topic

Is it possible to switch switch user accounts using autoit?

I.e. Perform an action on the account 'AccountOne'

Switch to 'AccountTwo'

Perform another action

Or is that too ambitious?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes, this may be possible if you have the password and account name for the second account. I might find out how to do it in a DOS command prompt first.

But this logs you off the first account at least:

Shutdown(0)
Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

OK, but will autoit sort of 'have control' even when in the user accounts menu?

Or are you suggesting there will be a command to directly switch to another account?

I do have the user/pass but will autoit still exist or be in control even when switched to another account? The tooltip probably just exists for the current account right?

Also as I said in the first line, can autoit type in a user and pass in the switch accounts menu - then that would make it easier? I'm on WinXP where you actually go to the login screen (blue one) where you click on the account - not the one where a box pops up and you type in your user/pass.

Has anyone made or know how to make an autoit program which does operate between user accounts?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

What I'm thinking is that in order for a script to continue running after you have logged off, is that it be registered as a windows service, and there is a way to do this that I recently came across, but it is not code that is native to AutoIt, for all that matters.

The forum member ptrex made a script to help to run a script as a service shown here

With your script still running after it logs one account off, you would find a way to figure out where to send mouse clicks and then use the AutoIt "Send" function to enter passwords, after using the Sleep function to await the system logoff operation.

You might look into RunAs, in the Help file:

Initialise a set of user credentials to use during Run and RunWait operations. 2000/XP or later ONLY.

RunAsSet ( ["user", "domain", "password" [, options]] )

See if you can't accomplish what you want to with RunAs Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

Oh I see, the autoit script will keep running on one account even when I come to the menu. there will be no differenece but the mouse will move itself, click and ente a password. then it would sleep and continue operation on the second account.

I'll try the run as method first

thank you for your tips

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Oh I see, the autoit script will keep running on one account...

I think it will require at least one reboot, but non-Microsoft programs that end up registered as services, end up listed under this registry key:

"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"

And so, programs started for being listed under this key, start before anyone logs on.

Edited by Squirrely1

Das Häschen benutzt Radar

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