Solved Automatically Log In To Main Account & Switch User

pepanee

New Member
Member
Messages
224
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 a moderator:

My Computer

System One

  • OS
    Windows 8.1 Professional (64-Bit)
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Self Built
    CPU
    Intel Pentium GPU G2020 2.90GHz
    Motherboard
    P8B75-M - CSM
    Memory
    8.00 GB
    Graphics Card(s)
    Nvidia GeForce 8400GS
    Monitor(s) Displays
    ASUS VS247
    Screen Resolution
    1280 x 720
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:
[COLOR=blue]<?xml version="1.0" encoding="UTF-16"?>[/COLOR]
[URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Task[/COLOR] [COLOR=red]xmlns[/COLOR]="[COLOR=red][B]http://schemas.microsoft.com/windows/2004/02/mit/task[/B][/COLOR]" [COLOR=#990000]version[/COLOR]="[COLOR=black][B]1.2[/B][/COLOR]">[/URL][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]RegistrationInfo[/COLOR]>[/URL]<[COLOR=#990000]Date[/COLOR]>2014-08-28T08:17:32.8816798[COLOR=blue]</[COLOR=#990000]Date[/COLOR]>[/COLOR]<[COLOR=#990000]Author[/COLOR]>COMPUTER\USER[COLOR=blue]</[COLOR=#990000]Author[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]RegistrationInfo[/COLOR]>[/COLOR][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Triggers[/COLOR]>[/URL][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]LogonTrigger[/COLOR]>[/URL]<[COLOR=#990000]Enabled[/COLOR]>true[COLOR=blue]</[COLOR=#990000]Enabled[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]LogonTrigger[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Triggers[/COLOR]>[/COLOR]
[URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Principals[/COLOR]>[/URL]
[URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Principal[/COLOR] [COLOR=#990000]id[/COLOR]="[COLOR=black][B]Author[/B][/COLOR]">[/URL]<[COLOR=#990000]UserId[/COLOR]>COMPUTER\USER[COLOR=blue]</[COLOR=#990000]UserId[/COLOR]>[/COLOR]<[COLOR=#990000]LogonType[/COLOR]>InteractiveToken[COLOR=blue]</[COLOR=#990000]LogonType[/COLOR]>[/COLOR]<[COLOR=#990000]RunLevel[/COLOR]>LeastPrivilege[COLOR=blue]</[COLOR=#990000]RunLevel[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Principal[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Principals[/COLOR]>[/COLOR][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Settings[/COLOR]>[/URL]<[COLOR=#990000]MultipleInstancesPolicy[/COLOR]>IgnoreNew[COLOR=blue]</[COLOR=#990000]MultipleInstancesPolicy[/COLOR]>[/COLOR]<[COLOR=#990000]DisallowStartIfOnBatteries[/COLOR]>true[COLOR=blue]</[COLOR=#990000]DisallowStartIfOnBatteries[/COLOR]>[/COLOR]<[COLOR=#990000]StopIfGoingOnBatteries[/COLOR]>false[COLOR=blue]</[COLOR=#990000]StopIfGoingOnBatteries[/COLOR]>[/COLOR]<[COLOR=#990000]AllowHardTerminate[/COLOR]>true[COLOR=blue]</[COLOR=#990000]AllowHardTerminate[/COLOR]>[/COLOR]<[COLOR=#990000]StartWhenAvailable[/COLOR]>false[COLOR=blue]</[COLOR=#990000]StartWhenAvailable[/COLOR]>[/COLOR]<[COLOR=#990000]RunOnlyIfNetworkAvailable[/COLOR]>false[COLOR=blue]</[COLOR=#990000]RunOnlyIfNetworkAvailable[/COLOR]>[/COLOR][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]IdleSettings[/COLOR]>[/URL]<[COLOR=#990000]Duration[/COLOR]>PT1M[COLOR=blue]</[COLOR=#990000]Duration[/COLOR]>[/COLOR]<[COLOR=#990000]WaitTimeout[/COLOR]>PT1H[COLOR=blue]</[COLOR=#990000]WaitTimeout[/COLOR]>[/COLOR]<[COLOR=#990000]StopOnIdleEnd[/COLOR]>false[COLOR=blue]</[COLOR=#990000]StopOnIdleEnd[/COLOR]>[/COLOR]<[COLOR=#990000]RestartOnIdle[/COLOR]>false[COLOR=blue]</[COLOR=#990000]RestartOnIdle[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]IdleSettings[/COLOR]>[/COLOR]<[COLOR=#990000]AllowStartOnDemand[/COLOR]>true[COLOR=blue]</[COLOR=#990000]AllowStartOnDemand[/COLOR]>[/COLOR]<[COLOR=#990000]Enabled[/COLOR]>true[COLOR=blue]</[COLOR=#990000]Enabled[/COLOR]>[/COLOR]<[COLOR=#990000]Hidden[/COLOR]>false[COLOR=blue]</[COLOR=#990000]Hidden[/COLOR]>[/COLOR]<[COLOR=#990000]RunOnlyIfIdle[/COLOR]>true[COLOR=blue]</[COLOR=#990000]RunOnlyIfIdle[/COLOR]>[/COLOR]<[COLOR=#990000]WakeToRun[/COLOR]>false[COLOR=blue]</[COLOR=#990000]WakeToRun[/COLOR]>[/COLOR]<[COLOR=#990000]ExecutionTimeLimit[/COLOR]>P3D[COLOR=blue]</[COLOR=#990000]ExecutionTimeLimit[/COLOR]>[/COLOR]
<[COLOR=#990000]Priority[/COLOR]>7[COLOR=blue]</[COLOR=#990000]Priority[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Settings[/COLOR]>[/COLOR][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Actions[/COLOR] [COLOR=#990000]Context[/COLOR]="[COLOR=black][B]Author[/B][/COLOR]">[/URL][URL="file:///C:/Users/adam/Desktop/lock%20screen.xml#"]<[COLOR=#990000]Exec[/COLOR]>[/URL]<[COLOR=#990000]Command[/COLOR]>rundll32.exe[COLOR=blue]</[COLOR=#990000]Command[/COLOR]>[/COLOR]<[COLOR=#990000]Arguments[/COLOR]>user32.dll,LockWorkStation[COLOR=blue]</[COLOR=#990000]Arguments[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Exec[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Actions[/COLOR]>[/COLOR][COLOR=blue]</[COLOR=#990000]Task[/COLOR]>[/COLOR]
 

My Computer

System One

  • OS
    Windows 10 Pro Prieview x64
    Computer type
    Laptop
    System Manufacturer/Model
    MacBook Pro Core2Duo
    CPU
    T7600
    Memory
    3
    Graphics Card(s)
    ATI Radeon X1600
    Monitor(s) Displays
    Internal
    Screen Resolution
    1440 x 800
    Hard Drives
    40GB
    Keyboard
    Apple
    Mouse
    Apple
    Internet Speed
    Varies
    Browser
    Various
    Antivirus
    Defender
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 Computer

System One

  • OS
    Windows 8.1 Professional (64-Bit)
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Self Built
    CPU
    Intel Pentium GPU G2020 2.90GHz
    Motherboard
    P8B75-M - CSM
    Memory
    8.00 GB
    Graphics Card(s)
    Nvidia GeForce 8400GS
    Monitor(s) Displays
    ASUS VS247
    Screen Resolution
    1280 x 720
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 Computer

System One

  • OS
    Windows 10 Pro Prieview x64
    Computer type
    Laptop
    System Manufacturer/Model
    MacBook Pro Core2Duo
    CPU
    T7600
    Memory
    3
    Graphics Card(s)
    ATI Radeon X1600
    Monitor(s) Displays
    Internal
    Screen Resolution
    1440 x 800
    Hard Drives
    40GB
    Keyboard
    Apple
    Mouse
    Apple
    Internet Speed
    Varies
    Browser
    Various
    Antivirus
    Defender
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 Computer

System One

  • OS
    Windows 8.1 Professional (64-Bit)
    Computer type
    PC/Desktop
    System Manufacturer/Model
    Self Built
    CPU
    Intel Pentium GPU G2020 2.90GHz
    Motherboard
    P8B75-M - CSM
    Memory
    8.00 GB
    Graphics Card(s)
    Nvidia GeForce 8400GS
    Monitor(s) Displays
    ASUS VS247
    Screen Resolution
    1280 x 720
Back
Top