Let your computer plug in your U disk before it can start

  

Today our skills are special, you can let the computer start after inserting your own U disk, otherwise it will automatically shut down after startup. The following is the implementation process of this method:

1. First determine the U disk The drive letter, you can plug your own U disk, and then you can see the drive letter, this step is very important, if the drive letter is wrong, then let your computer sleep;

2. Create a file in the U disk, 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 (using Save Notepad as .bat), its content is as follows:

ifnotexistI:\\123.ljshutdown-s-t10-c"You can't use this computer"

Here I For the U disk drive letter, this sentence means that if the file 123.lj does not exist in the USB flash drive, the computer is turned off after 10 seconds and the message "You cannot use the computer" is displayed.

4. Enter "gpedit.msc" in the run to open the group policy and locate the following path: "Local Computer" Policy → Computer Configuration → Windows Settings → Script (Start /Shutdown), then on the right Select the "Start" item in the box and add the batch file you just created to the list of startup scripts. OK and exit.

When you get here, you're done. At this time, you can only start the computer and enter the system by plugging in the USB flash drive. 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 the U disk.

1. If there is enough time, you can enter "shutdown-a" in the run to release the shutdown command;

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

Copyright © Windows knowledge All Rights Reserved