Windows 8 and 8.1 Forums


Automatically Log In To Main Account & Switch User

  1. #1


    Posts : 224
    Windows 8.1 Professional (64-Bit)

    Automatically Log In To Main Account & Switch User


    I read a few articles on how to make Windows 8 automatically log in, yet I wantWindows 8 to automatically log in to the main account which is password protected AND automatically switch user.

    I want to do this because sometimes when I turn on the computer, I walk away then come back to it. You see, the reason why I want to do this is because when I turn on the computer and come back to it to log in my account, there's a little bit of a wait time to load up the account. If the computer automatically logs in and switches the user, then when I come back to the computer, all I have to do is type in the password, and everything is already loaded in that account.

    Is that option possible? It must be.
    Last edited by Brink; 27 Aug 2014 at 23:22. Reason: removed links

      My System SpecsSystem Spec

  2. #2


    Posts : 1,875
    Windows 10 Pro Prieview x64


    Do you really want to switch users or you want your screen password protected?

    It sounds to me you want to log on and then after (say 1 minute of being idle) lock the screen. To do this you could set up a new Task Scheduler task to call this: rundll32.exe user32.dll,LockWorkStation

    Enclosed is an example task you can import - copy the xml below into notepad and save it as lockscreen.xml (.xml attachments can't be uploaded here). You can then import it into task scheduler.


    You will need to change the user (COMPUTER\USER) and may want to play with the idle time, delay time. You can do this when you import the task - no need to edit the xml.

    Code:
    <?xml version="1.0" encoding="UTF-16"?>
    <Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task" version="1.2"><RegistrationInfo><Date>2014-08-28T08:17:32.8816798</Date><Author>COMPUTER\USER</Author></RegistrationInfo><Triggers><LogonTrigger><Enabled>true</Enabled></LogonTrigger></Triggers>
    <Principals>
    <Principal id="Author"><UserId>COMPUTER\USER</UserId><LogonType>InteractiveToken</LogonType><RunLevel>LeastPrivilege</RunLevel></Principal></Principals><Settings><MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy><DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries><StopIfGoingOnBatteries>false</StopIfGoingOnBatteries><AllowHardTerminate>true</AllowHardTerminate><StartWhenAvailable>false</StartWhenAvailable><RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable><IdleSettings><Duration>PT1M</Duration><WaitTimeout>PT1H</WaitTimeout><StopOnIdleEnd>false</StopOnIdleEnd><RestartOnIdle>false</RestartOnIdle></IdleSettings><AllowStartOnDemand>true</AllowStartOnDemand><Enabled>true</Enabled><Hidden>false</Hidden><RunOnlyIfIdle>true</RunOnlyIfIdle><WakeToRun>false</WakeToRun><ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority></Settings><Actions Context="Author"><Exec><Command>rundll32.exe</Command><Arguments>user32.dll,LockWorkStation</Arguments></Exec></Actions></Task>
      My System SpecsSystem Spec

  3. #3


    Posts : 224
    Windows 8.1 Professional (64-Bit)


    Hi adamf, thank you for your reply.

    "Switch User" and "[having the] screen password protected" is the same thing pretty much, no? (both would apply if I press Windows Button + L).

    Yet the thing is that I only want this task to happen after the computer is turned on:
    I press the On button, Windows 8 loads up, then it will automatically log into the password protected Administrator account, and automatically "password protect", or "Switch User". I don't want this to happen all the time for idle time. Only for the first time the computer loads up.
      My System SpecsSystem Spec

  4. #4


    Posts : 1,875
    Windows 10 Pro Prieview x64


    The task above is invoked at user log on. It isn't invoked every time the system is idle.

    If you want you could remove the 'Start the task only if the computer is idle' tick box. Then it would always run on log on.

    EDIT: And yes, Crtl + L does rundll32.exe user32.dll,LockWorkStation
      My System SpecsSystem Spec

  5. #5


    Posts : 224
    Windows 8.1 Professional (64-Bit)


    Oh wow, that (the xml file) actually did work. Once I typed the password to log in, it switched the user right away (while loading up the user account).

    The only thing that I might see a little weird is that for the first part of this... typing the password and it shows in plain text in the registry (for the auto log-in).

    Okay thank you very much for the auto-switch option.
      My System SpecsSystem Spec

Automatically Log In To Main Account & Switch User
Related Threads
How to Automatically Sign in to User Account at Startup in Windows 8 and 8.1 This will show you how to have Windows 8 or 8.1 sign in to a local user account or Microsoft account of your choice automatically at startup without the user needing to enter a user name and password. You must be...
The user account is automatically logged off from my PC Windows 8 though the antivirus program is still running. Thus, I have to reenter the password to check the program running status. How to prevent user account to be automatically logged off in windows 8? I have already selected Never in the...
Hey all, I have spent the weekend trying to figure out how to change my account type back to administrator but with no luck. I have been running this laptop as my main machine for a few months now with no problems, however, I realised I had a problem when I wanted to change some networking...
Hi, I upgraded to from 8 to 8.1 last night and now my main account is not showing up on the front screen for me to be able to log into it. All the other accounts are there. I've looked in 'C\Users' and the folder is still in there, any idea what's going on and how I can reinstate it? I also had a...
i deleted my main windows user account in User Accounts and Family Safety
Hey guys, about 7 hours ago i deleted my main windows user account and ever since ive been working tirelessly to try and fix the problem. every time i boot up it automatically takes me to a temporary profile with the same name as the previous one that i deleted and because its a temp profile i...
Another user account automatically appears in User Accounts and Family Safety
Hi there, Another user account by name of "xjlrpizeav" or "John" appears along with my account. I delete this account and its files but after some times it appears again. What should i do? Plz help....
Eight Forums Android App Eight Forums IOS App Follow us on Facebook