How to Lock Windows Computer from Command Line

 

In command line type:

rundll32.exe user32.dll,LockWorkStation

That will lock Windows.