Developer & Internet Marketer

Welcome to my blog.

Sed sed leo sit amet elit sagittis fermentum. Nulla posuere commodo erat. Nam ac nunc ipsum, id espara tincidunt orci. Quisque adipiscing molestie dolor, ut congue sem porta et. Sed sapien urna, auctor et accumsan ut, accumsan sit amet dui. Nunc tristique interdum magna, dictum volutpat sem. Nam ac nunc ipsum, id espara tincidunt orci. Sed sapien urna, auctor et accumsan ut.

How Can I Lock my Computer using DOS or Batch Command?

May 4, 2017wp-himu0 Comments

Today I was just playing with my computer’s task manager to terminate some unnecessary running processes so that it will work faster. VLC was not playing HD movie smoothly. Anyway terminating some process didn’t help me but I found a new way to lock my computer system.

In the task manager I terminated explorer. Explorer is responsible for exploring our computer system. If there is not explorer then we can’t browse anything on computer.

As I had learnt batch programming and some DOS commands I found a simple way to lock my computer with DOS and Batch.

Keyboard Shortcuts to lock my computer

Before I tell you my way I want to mention the traditional way to lock you windows system. There is a combination of shortcut keys to lock your computer and this works superb when you have a password on your user account.

Press Window Key + L

These two keys when pressed together will lock your session.

How to lock your computer using DOS

I have a simple command to stop explorer service so that you system and session remains active and visible but nothing should be accessible.

Warning:  Before you try please write these two commands somewhere otherwise you have to restart your system to revoke explorer service.

The DOS command to lock your computer can also be used in RUN. To open DOS (command prompt), search for CMD or type it in RUN (Press Ctrl+R). A black window which is command prompt will be on your screen now. Type the following DOS command in it.


This command will simply kill or terminate the Task whose Image name is explorer.exe with force as some operating system might not allow you to terminate explorer.

Now to resume explorer remember this simple command


These above commands can also be written in small case. Also you can use CLS command to clear the screen.

How can I lock my computer using BATCH?

Now if you want to automate the above process you have to create a batch file. A batch file is a file whose extension is .bat and has batch/dos commands written in it.

Open Notepad type the following DOS command in it



and save it as Anyname.bat so that it will be saved as a batch file not a Anyname.bat.txt file. You can also create one more file for the other remaining command.

The start command will help to keep command prompt (DOS)

open.I hope you enjoyed this computer trick and if you’re having any problem with it please share it with us.

Leave a Reply
www.edatastyle.com www.introducingsomething.com