How to make idle U disk into PC boot key

Source: Internet
Author: User
Tags zip

let u disk into a PC boot key scheme of course, the following small series to provide you with a program, the basic idea is:

Let the program automatically judge a U disk in the total capacity of a certain type of file, the correct judgment is passed, the error is off the machine. The following test passes in the Windows 7 operating system. Suppose the U disk letter is F: There are several fixed zip files (which cannot be changed later).

First, we need to get the total capacity of several zip files in the U disk, accurate to byte. The specific method is to execute the command in the command Prompt window: "DIR f:*. Zip ", the white content of the picture is the total size of the zip file (you need to press their own U disk in the actual number of files modified).

Next, open Notepad and enter the following code:

@echo off

Dir f:*. ZIP | Find "1,552,827 bytes"

If "%errorlevel%" = = "0" (

echo "Audit Pass"

) Else (

Shutdown-f-S

)

The above command first uses the "dir" command to list the total volume of the zip file in the U disk, and then use the "find" command to look for "1,552,827 bytes" (The total capacity of the zip file we have previously recorded), if not found then execute the shutdown command.

Save the above to a bat batch file, as long as the extension is bat, the filename is arbitrary, for example, can be saved as key.bat.

In order not to let other people see our source code, we also need to use the "bat to Exe Converter" software (download the address of your own search) the Bat file into an EXE file. After starting the software, select the Key.bat file we just built in the "Batch files" column, select "Stealth Application" in the "visible" column on the Options tab, and click "Compile" to complete the conversion.

Now we drag the converted Key.exe file to the "start → all Programs → startup" folder, you can insert the specified U disk to boot. Note that after compiling, our boot U disk can no longer arbitrarily access or delete the zip format file (preferably what files are not added or deleted), once you lead a U disk in the zip file occupied by the disc space changes, will appear oneself also can not open the situation of the machine!!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.