3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Computer Lock

Computer Lock
Many people have often left the computer for a moment and when you come back a sibling is now on it. Then there are the people that just want to lock there computer. With this program that i wrote your computer will be locked from any one and if five incorrect answers are entered then you will be locked out for five minutes. It will automatically enter your user name where needed. In this instructable i will show you how this program works.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Getting Started

Getting Started
In the code below the program prompts for user input and decides weather or not you are correct.



@echo off & setlocal      "This line makes it so that you don't see every command run"
set /a counter=0      "this sets a counter to zero"
color 7      "this tells the program that the screen should be black with white letters"
:header      "this is a reference point to direct the program to.
title Lock Computer II for %username%    "this creates a title for the window with your username% 
cls      "this clears the screen"
taskkill /f /im explorer.exe       "this line force quits the explorer program that shows you your
computer"

goto start121       "this directs the program to the reference pooint start121"
:COUNTERSET       "reference point"
set /a counter=0      "counter is set again to zero"
:start121      "reference point"
color 7      "sets the color to black and white"
cls      "clear"
echo This computer is in use and has been locked.       "displays"
echo.       "displays an empty line"
echo Only Nick can unlock this computer.       "displays"
echo.       "displays an empty line"
echo If you are experiencing any difficulties contact the author by typing author.       "displays"
echo.       "displays an empty line"
set unlockcode=      "makes the variable unlockcode"
set /p unlockcode=Enter the Unlock Code to unlock this computer.      "prompts for user input"
if '%unlockcode%'=='legolas1' goto unlock       "checks for password and directs to a reference point%
if '%unlockcode%'=='Author' goto contact      "checks for password and directs to a reference point%
if '%unlockcode%'=='author' goto contact      "checks for password and directs to a reference point%
if not '%unlockcode%'=='legolas1' goto middle      "checks for password and directs to a reference point%

« Previous StepDownload PDFView All StepsNext Step »
8 comments
Apr 5, 2010. 8:03 PMSpike68 says:
Well made program and well made instructable. But if this is running, a person can kill it with Ctrl Alt Del, or just reboot the computer.

Good job otherwise.
Jun 4, 2011. 11:31 AMSuper_Nerd says:
Umm wouldn't explorer.exe cancel ctrl alt del? Also Rebooting the system is like a self destruct if you want to see what they're doing.
Jan 21, 2012. 1:48 PMaccount3r2 says:
No, actually, it wouldn't. taskmgr.exe is its own program and Ctrl+Alt+Del or Delete and Ctrl+Alt+Esc are hotkeys. If it cancelled it, wouldn't it also cancel everything else? Try it! I have made many programs like this and you may still use that and other programs, too, and from Task Manager you may start up explorer.exe or if you have a hacked one, like me :D , you may start that, too, by clicking "New Task..." then type explorer.exe or whatever your directory of your hacked version is.
Apr 14, 2010. 1:37 AMLunera says:
Even further, one could always just hit Clrl-Alt-Del, and click "Lock" to get the same effect.
Jul 17, 2011. 12:51 AMJamez Britton says:
When i downloaded the computer lock.zip file comodo antivirus said it was a trojan horse virus.
Aug 11, 2010. 2:22 AMoctavian234 says:
I made a code like this once. (before i moved onto bash and then C) but as soon as I noticed the flaws I realized it was not very functional
Apr 26, 2010. 9:30 PMzchampine says:
 WinKey + L locks your computer as well.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2
Followers
8
Author:alester27