![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-12 02:26 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS批处理 & 脚本技术(批处理室) » One-click Lock Computer Using Batch File [Original] |
| Printable Version 3,144 / 10 |
| Floor1 杨上当 | Posted 2003-04-13 00:00 |
| 初级用户 Posts 17 Credits 186 | |
|
Hello everyone! I'm just a noob. I always admire those who are proficient in DOS. Now through this forum, I've also learned a lot about DOS knowledge. Now I made a self-written batch file (named Norun.bat) which can restrict the use of the computer by modifying the registry. I earnestly ask all experts to give comments!
Here is the content of Norun.bat (for the convenience of narration, paragraph marks are added): Paragraph 1 pause Paragraph 2 @ECHO off regedit -s d:\norun.reg Paragraph 3 @ECHO off ren c:\windows\regedit.exe yjf.exe Paragraph 4 @echo off ren C:\WINDOWS\SYSBCKUP\RB000.CAB yjf Paragraph 5 @echo off attrib "c:\windows\start menu\*.*" +h /s Paragraph 6 @ECHO off C:\Windows\Rundll.exe user.exe,exitwindowsexec Before running this batch file, you must do the preparation work: create "norun.reg", "run.reg" and "Warning Sound.wav" in the D drive. After running this batch file, the computer will restart forcibly. After self-testing, a warning box will pop up, and then a warning sound will come out from the speaker. That's not all. The desktop is empty, and even no drive is found when opening Windows Explorer. What's worse, it seems that no program can be run! I will make some annotations on Norun.bat: Paragraph 1, use the pause command to prevent accidental running. Paragraph 2 is to merge the norun.reg file into the registry, which is the key to locking the computer. Among them, the role of adding the parameter "-s" after the regedit command is to directly inject the reg file into the registry without confirmation. Now focus on explaining the content of norun.reg: REGEDIT4 "RestrictRun"=dword:00000001 (Prohibit running any program) "nodrives"=dword:ffffffff (Hide all drives) "nodesktop"=dword:00000001 (Hide desktop) "1"="run.bat" (Allow running run.bat, which is the batch file for unlocking, and the details will be introduced below) "2"="run.pif" (This refers to allowing running the shortcut of run.bat. If this item is not available, then only the original file of run.bat can be run but not its shortcut when unlocking) "3"="regedit.exe" (Must allow running the registry editor, otherwise we can't quickly unlock ourselves. As for how to prevent others from running the registry editor, it will be explained below) "LegalNoticeCaption"="I don't welcome you!!!" "LegalNoticeText"="Unauthorized use is not allowed!! If you have urgent matters, please contact Yang Shangdang." (This is the warning box, which will pop up after the computer starts self-testing) @="D:\\Warning Sound.wav" (Replaces the original Windows startup sound to further warn illegal users.) Paragraph 3 is to prevent others from running the registry editor. Rename regedit.exe to "yjf.exe", so those who don't understand can't run the registry editor! Paragraph 4 is to rename the registry backup file in the system, so as to prevent others from restoring the registry by running "scanreg /restore" under DOS! Brutal, right? Paragraph 5 is to set all shortcuts in the start menu to hidden attributes, so the start menu will be empty. To achieve this purpose, it must be noted to put the path in quotes, because DOS doesn't recognize file names with spaces! Paragraph 6 is to command the computer to restart. Here is the content of the unlocking run.bat: pause @echo off ren c:\windows\yjf.exe regedit.exe @echo off attrib "c:\windows\start menu\*.*" -h /s @ECHO off regedit -s d:\run.reg This batch file is very easy to understand, and no need to elaborate here. Only explain the content of run.reg: REGEDIT4 "RestrictRun"=dword:00000000 "nodesktop"=dword:00000000 "nodrives"=dword:00000000 (Unlock the program, restore the desktop, and restore the display of drives) "LegalNoticeCaption"="" "LegalNoticeText"="" (Remove the warning box) @="C:\\WINDOWS\\media\\The Microsoft Sound.wav" (Restore the default sound at startup) After restarting or logging off, the computer returns to normal. |
|
| Floor2 杨上当 | Posted 2003-04-13 00:00 |
| 初级用户 Posts 17 Credits 186 | |
|
Since this is my first post in this forum, I'm a bit nervous. There was an error in the previous post that I need to correct: In the content of norun.reg, the registry entry for hiding the desktop was written as "nodesktop"=dword:00000000. Actually, it should be "nodesktop"=dword:00000001. Very sorry!
I'm really a newbie. I didn't know I could edit my own post! Now I've corrected the error in the previous post. But I want to delete this current post. How can I do that? I beg the moderator to delete this current post of mine! It's really painful to look at! |
|
| Floor3 杨上当 | Posted 2003-04-13 00:00 |
| 初级用户 Posts 17 Credits 186 | |
|
You can create a shortcut for "norun.bat" named "norun" and place it in the Start menu. Then, to lock the computer, just press the Windows icon key and then press N. Additionally, create a shortcut for the unlock file "run.bat" and put this shortcut in the Quick Launch toolbar. Then, to unlock, just click it in the Quick Launch toolbar. Do you think this little secret is easy for others to figure out? Actually, for real application, you must definitely encrypt "run.bat". I have been using "Li Wei Encryption System" all the time. It is a very small and easy-to-use free green software. Personally, I think although there are many encryption software nowadays, none is as good as it! Just don't know if it can still be found online now. If any friends are interested, tell me and I'll send it to you.
|
|
| Floor4 icaza | Posted 2003-04-13 00:00 |
| 初级用户 Posts 2 Credits 110 | |
|
My e-mail: hover967@hotmail.com Can you send it to me? I'm just looking for this thing : )
|
|
| Floor5 杨上当 | Posted 2003-04-14 00:00 |
| 初级用户 Posts 17 Credits 186 | |
|
I have sent the encryption machine to you, please check it!
|
|
| Floor6 杨上当 | Posted 2003-04-14 00:00 |
| 初级用户 Posts 17 Credits 186 | |
|
May I ask the experts:
I. How to change the attributes of a folder under DOS? II. Is it possible to require the user to enter a password to continue execution during the execution of a batch file? |
|
| Floor7 yeah | Posted 2003-04-14 00:00 |
| 中级用户 Posts 54 Credits 347 | |
|
Expert!
|
|
| Floor8 tanglu_sd | Posted 2003-04-15 00:00 |
| 高级用户 Posts 271 Credits 948 From sd | |
|
Could you send me the encryption machine? Thanks.
Mail: tanglu_sd@etang.com |
|
| Floor9 杨上当 | Posted 2003-04-16 00:00 |
| 初级用户 Posts 17 Credits 186 | |
The following is a quote from tanglu_sd on 2003-4-15 22:50:12: I have already known how to set a password for the operation of a batch file. Just add the following in the batch file: @echo off choice /c:(password)/n. For details, please refer to my post: http://www2.zzu.edu.cn/ie/newdos/dispbbs.asp?boardID=12&ID=1870. However, I will still send you the encryption machine you requested. |
|
| Floor10 xqx | Posted 2010-08-04 07:09 |
| 初级用户 Posts 25 Credits 28 | |
|
Pass by and I'll also say:
1. Sixth paragraph @ECHO off C:\Windows\Rundll.exe user.exe,exitwindowsexec It doesn't work in my .bat! 2. REGEDIT4 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] "RestrictRun"=dword:00000001 (Prohibit running any program) "nodrives"=dword:ffffffff (Hide all drives) "nodesktop"=dword:00000001 (Hide desktop) This .reg I directly put into the .bat, this seems simpler. I'm here for the first time in DOS, please forgive me if I'm wrong. |
|
| Floor11 xqx | Posted 2010-08-04 07:24 |
| 初级用户 Posts 25 Credits 28 | |
|
Is what you made here have two .bat and two .reg? I tried and maybe two .exe can be used. Could you please send it to xqxxqx666@163.com Thanks!
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |