Windows Command To Lock Screen, Then, at the command prompt, enter the below command and press enter: Rundll32.