Skip to main content
InSource Solutions

TN WW207 Auto-Locking a Windows Account upon Boot

InSource_Logo_Transparent (1).png

 

Description

 

This article from InSource shows how to have an account automatically locked out as soon as a user first logs on.

  • Author: Joseph Hefner
  • Published: 05/30/2018
  • Applies to: All

Details

Sometimes it might be necessary to have an account automatically startup upon boot and lock the logged in account. This can be necessary if software cannot run as a windows service but needs to be running every time the computer boots up. Below are the steps to automatically logout a user upon initial logon.

 

Step 1) Open up a new notepad.

Cap1.jpg

 

Step 2) Type the following:

rundll32.exe user32.dll,LockWorkStation

Cap2.jpg

 

Step 3) Save as a bat file:

Cap3.jpg

Step 4) Place the bat file into the startup folder at the locations below.  These locations may be different depending on the Operating System:

  • C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp