First, we open Notepad, enter the following content and save as Ukey.bat.
@echo off
If not exist e:/test.txt Shutdown-s-T 0
For an explanation of scripting code:
1.e:/test.txt you can set your own file name and type, such as Jannick.jpg or Jannick.exe, the key is e:/, first you have to know what your computer to the U disk to give the letter, such as my is e disk, you may be different, please adjust their own.
2. Any search for a file, named Test.txt and put it in the root directory of U disk, the file name is the same as above.
3.shutdown parameters I do not explain too much, want to study the can be entered under cmd shutdown/? Look at the detailed instructions, I am here to shut down the machine.
XP system users have direct access to the following folders, but to open the show System folder contents in Folder Options, copy Ukey.bat to the destination folder. %systemroot%/system32/grouppolicy/user/scrīpts/logon.
Second, next, click Start-run-gpedit.msc-Computer Configuration-windows Settings-script-Add, find your ukey.bat and add in-ok-ok, OK.
In this way, a simple USB u disk boot lock on the production is completed, the next time you turn on the computer must be inserted on the U disk to start, remember Oh! Keep your U disk boot lock, do not lose or the U disk damaged, so it will be trouble.