How to make the computer start after inserting your own USB flash drive

  
I read this article today and I feel that it is good to share with you, let the computer start after inserting its own USB flash drive, otherwise it will automatically shut down after startup. The following is the implementation process of this method:
1. First determine the USB flash drive Drive letter, you can plug your own USB flash drive, and then you can see the drive letter, this step is very important, if you mistake the drive letter, then let your computer sleep;
2. Create a file in the USB flash drive, the file name and extension are arbitrarily entered. For example, the file created by the author is 123.lj;
3. Create a batch file on the local disk (Save it as .bat with Notepad) The content is as follows:
ifnotexistI:\\123.ljshutdown-s-t10-c"You cannot use this computer"
I here is the USB flash drive letter, this sentence means if the USB flash drive If there is no file 123.lj, the computer will be shut down after 10 seconds and the message "You cannot use this computer" will be displayed.
4. In the run, type "gpedit.msc" to open the group policy, and locate the following path: "local computer" strategy → computer configuration → Windows settings → script (start /shutdown), Then select the "Start" item in the box on the right and add the batch file you just created to the list of startup scripts, OK and exit.
Where you are here, you can do it. Only when you plug in the USB flash drive at boot time can you start the computer and enter the system. Otherwise, the following prompt will appear and the computer will be shut down within the specified time:
In addition, let's talk about the loss of the USB flash drive. The solution below.
1. If there is enough time, you can enter "shutdown-a" to cancel the shutdown command during the run;
2. You can also start the computer to safe mode to delete the startup script, because in safe mode Is not going to load the boot script

Copyright © Windows knowledge All Rights Reserved