Jump to content
Exit

How to switch user ?

Recommended Posts

No luck in using search for switch user.

I have two user accounts on a Win10 64bit PC and want to easily switch from one user to the other by a desktop Icon.

I found a solution here , but it uses shutdown restart with registry tweaks.

Is there a way to just Logout/Login ? Any ideas ?

I will code myself, but some pointers are welcome. :)

 


UDF: _SingleScript()                                        If you like my post, just click the like button :)        here -->

Share this post


Link to post
Share on other sites

Send() function does not accept WIN+L

See my script:

; SwitchUser  (work in progress)

Send("#l")  ; does NOT open "switch user" window, but types "l" at the current cursor location.

; Place cursor here -->  <-- and press F5

 


UDF: _SingleScript()                                        If you like my post, just click the like button :)        here -->

Share this post


Link to post
Share on other sites

_WinAPI_LockWorkStation() can be used instead if #l, but this won't allow you to automate the user login.

A way could be to apply an autologon (with autologon.exe : https://technet.microsoft.com/en-us/library/bb963905.aspx), but it requires a reboot to be effective.

 

Share this post


Link to post
Share on other sites

_WinAPI_LockWorkStation() can be used instead if #l, but this won't allow you to automate the user login.

Confirmed. :(

 

A way could be to apply an autologon (with autologon.exe : https://technet.microsoft.com/en-us/library/bb963905.aspx), but it requires a reboot to be effective.

That is the same as my reference in first post.

But I would like to preserve my first session and switch to the other session. And vice versa.
Btw, this would be much faster than rebooting.

Any ideas ?

 


UDF: _SingleScript()                                        If you like my post, just click the like button :)        here -->

Share this post


Link to post
Share on other sites

If you are unable to switch users in windows 10 without restart, you can try command prompt to switch users. I can't say with confidence but may it can help you.
Just open cmd and enter "runas /user:*computer name\*account name explorer.exe" and press enter. It will switch you in your account you entered.

 Source: https://windowsclassroom.com/how-to-switch-users-on-windows-10/

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

  • Similar Content

    • By Skysnake
      From From here, bottom of the post
      I am not arguing the logic of this, merely would like to point out that if there is such a rule, it is not documented...  Are there other such rules?
      Skysnake
    • By VIP
      I can not do anything with any user in the "Local Users Group"
      I tried from my account but I could not change my password (ie set new password)!
      But I was able to activate the Administrator account and I logged into the Administrator account and still could not do anything with my account! But I can set the password and disable the Administrator account from my account or Administrator.
      Any ideas? (Ignore the click on the Sign-in option in the Change Accout settings.)
       

    • By FrancescoDiMuro
      Good morning guys
      How are you? Hope you're fine
      I'm doing some field checking...
      Can you suggest me something? Something like: If the user doesn't prompt anything in a field, MsgBox and focus on the "blank" field, else, keep up with the script.
      I thought on a nested If...Else, but I have something like 10+ edit to control...
      Thanks guys! 
      EDIT:
      And I would like to know either how to retrieve all listview item ( 2 columns ) from a ListView...
      Column A|Column B
      abcd         | 1234
      bcda         | 1432
      How can I retrieve an array with abcd|1234|bcda|1432 ?
      Thanks  
       
    • By WoodGrain
      Hi guys,
      Could someone please tell me what I'm doing wrong with this code?
      I'm trying to take user input and then run a function with the same name, but it's not calling the function.
      So in the below after pressing Shift+F8 I would enter the text (without quotes) "testFunc".
      As you can see I've also tried this with IF statements, I'm new to using Switch/Case.
      HotKeySet("+{F8}", RunManually) Func RunManually() ;Use a case statement with 1 hot key and an InputBox to manually run functions $funcName = InputBox("Which Func to Run?", "Enter the name of the function to run") MsgBox(0, "Entered value", $funcName) ;If $funcName = testFunc Then testFunc() ;If $funcName = test2Func Then test2Func() Switch $funcName Case testFunc MsgBox(0, "Calling", "Calling Function") testFunc() MsgBox(0, "Called", "Function call finished") Case test2Func MsgBox(0, "Calling", "Calling Function") test2Func() MsgBox(0, "Called", "Function call finished") EndSwitch EndFunc While 1 ;testFunc() Sleep(1000) WEnd Func testFunc() MsgBox(0, "func running", "Seems to work!") EndFunc Func test2Func() MsgBox(0, "func 2 running", "2 Seems to work!") EndFunc Thanks!
    • By ur
      I have never used switch in AutoIT earlier.
       
      But today, when I started to implement it in my code, I am getting errors.
      So I tried to execute default example, but still getting the same error.

      Any suggestions please...
×
×
  • Create New...