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 drive letter of the USB flash drive, 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, 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 on the local disk The file (can be saved as .bat with Notepad), its content is as follows:

ifnotexistI:\\123.ljshutdown-s-t10-c"You cannot use this computer"

where I is the USB flash drive letter, this sentence means that if the file 123.lj does not exist in the USB flash drive, the computer will be shut down after 10 seconds, and the message "You cannot use the 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 /Shut down), 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.

You are done here. At this time, you can only start the computer and enter the system by plugging in the USB flash drive at boot time. Otherwise, the following prompt will appear and the computer will be turned off within the specified time:

Let me talk about the solution in the case of the loss of USB flash drive.

1. If there is enough time, you can enter "shutdown-a" to cancel the shutdown command during operation;

2. You can also start the script by deleting the computer into safe mode. Because it is not loaded in the safe mode

Copyright © Windows knowledge All Rights Reserved