7527 shaares
To lock your Windows PC using Command Prompt, run Rundll32.exe user32.dll,LockWorkStation in the Command Prompt
To set the lock screen timeout, run powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK <time> in Command Prompt as Admin
Activate the lock screen timeout setting by running powercfg.exe /SETACTIVE SCHEME_CURRENT after you set the timeout.