loading

I have seen many screen locks on the internet, so I decided to try to make one. I decided to publish it because it can be very useful to lock your computer if you don't have a password on it. So I will teach you how to make it. Or just skip to step 6 to download my pre-made one.

This program is not that complicated, all it does is lock your computer with the password that you provided in the file. PS: the cancel button does not work =D.

The program was made using VBScript.

NOTE: If you do not know vbscript, here is a introduction that will help you out, LINK(but if you have basic knowledge of vbs or VB.NET this script should be easy to understand =D)

ALSO NOTE: If you are interested in a free vbseditor, here is one. There is also vbsedit which I use.

Step 1: My Script...

Here is two versions of the script......

Windows XP to 7------->LINK, Windows 8 and up------->LINK

Download and extract the zip file, then right-click on Screen Lock.vbs and edit with any text editor, MAKE SURE TO MAXIMIZE THE WINDOW.


Step 2: Your Password

To set your password, enter your password in between the quotes in the file. Passwords are case sensitive.

The way this script works, is that it disables several ctrl-alt-delete options to prevent unauthorized changes while your computer is locked. Then re enables them when you enter the correct password.

NOTE: Since it is impossible to mask password input in vbs, I recommend dragging the application to the bottom of the screen so that the input section is hidden and then typing in the password.

Step 3: Custom Message...

You can edit the message that would appear on the logon screen if the user tried to abort the lock. To set the text, enter your message in between the quotes in the script as in the picture.

Step 4: Adding a Drive Locker...

If you have seen my VBScript Drive Lock you will know that it is possible to lock drive(s) using vbs. So I will teach you how to incorporate into the screen lock.
NOTE: This is an optional feature, by default it is not in the default script or in my pre-made one on step 6.

So first open up notepad and paste the following information:

Objshell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewOnDrive", 67108863, "REG_DWORD"

First you will notice the following number '67108863'. This number is telling which drive to be locked. By default, the program will lock all drives, but if you want to lock only one drive, you would have to look at this chart to know which number:

A – 1, B – 2, C – 4, D – 8, E – 16, F – 32, G – 64, H – 128, I – 256, J – 512, K – 1024, L – 2048, M – 4096, N – 8192, O – 16384, P – 32768, Q – 65536, R – 131072, S – 262144, T – 524288, U – 1048576, V – 2097152, W – 4194304, X – 8388608, Y – 16777216, Z – 33554432, ALL – 67108863

So for example if I wanted to lock the C drive, I would replace 67108863 with 4.

Now paste in that code into your vbscript as the location in pic 1.

Now to add the function to unlock the drives once the user has entered the correct password, paste in this code into the vbscript as in pic 2.

Objshell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoViewOnDrive"

So now you are done installing the drive lock feature and you can move on to the next step!

NOTE: If you ever forget your password, to unlock the drives, just open up regedit and navigate to (pic 3)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\

Right click on NoViewOnDrive and click delete. Log off and on your account to see the changes.

Step 5: Adding the File to the Startup...

To add this file to the startup unless you are using windows xp, first you must change the admin prompts to never notify so that it will lock your computer automatically without prompt.

Then create a shortcut of the .vbs file, drag and drop the file to the start up folder. Here is a link with more details on how to do this: LINK

NOTE: There is another method of making this program automatically run as an administrator without changing the settings for all programs, if you are interested click here.

Step 6: Hope This Was Helpfull!

Hope this was helpful and if you need any help or have any questions/concerns please pm me or post a comment.

If you want to learn more about how this script works, please pm me and I'll explain it the best I can.

Also, if you do not feel like creating the file yourself, I have made one were each time you run the .vbs you set your own password such as in the picture above. You can download it here: LINK

<p><strong>NOTE: If you ever forget your password for this program </strong>and you added the program to the startup, restart windows and press F8 on restart to boot into safe mode. Then go into the start menu and delete the file in the startup folder, then restart the computer and boot back into windows normally. Then to re-enable the ctrl-alt-delete options, reset your password in the script, then compile it, and run it again. Enter your password and then all the options will be re-enabled.</p>
<p>what is the default password, i launched it and i cant get to my desktop</p>
<p>I just updated a little GUI version I made using hta. This one just like my previous GUI one, masks the password input, but this one also disables alt-f4, etc. If you want the source code, just ask. </p>
<p>I just fixed the &quot;black screen bug&quot;. Turns out my code had to be:</p><p>Objshell.run &quot;cmd /c explorer.exe&quot; instead of </p><p>Objshell.run &quot;explorer.exe&quot;</p>
<p>i cant even restart my computer, any help?</p>
<p>I think your computer launched the wrong explorer.exe:</p><p><strong>To fix press ctrl-alt-del and open task manager, then go to file---&gt;new task and type &quot;explorer.exe&quot;. Press ok.</strong></p><p>You were supposed to set the password in the file, but if you did not change it then the password is:</p><p>win xp to win 7:</p><p>----------YOUR PASSWORD HERE----------</p><p>or for win8+:</p><p>---------------YOUR PASSWORD HERE---------------</p>
<p>and uhhh i just went to my other computer redownloaded it, got the password, but the black screen still stays for me</p>
<p>what is the default password, i launched it and i cant get to my desktop</p>
<p>Nice</p>
<p>I've been creating a GUI for the screen lock, I probably won't publish it but this one can even mask the password input since it uses hta. It looks a little distorted in the comment though.</p>
<p>Just updated all the files, the screen lock is now even faster and no longer creates temporary files.</p>

About This Instructable

3,586views

8favorites

License:

Bio: Hello, my name is xp4xbox, a really old name that really has nothing to do with xbox consoles. Anyway I enjoy making programs and have ... More »
More by xp4xbox:USB Rubber Ducky Script Encoder (VBScript) Simple Netcat Backdoor VBScript Drive Lock 
Add instructable to: