How to add a password to a U disk

Source: Internet
Author: User

Step 1: First copy a small volume of JPG and WAV format files to the U disk, and then set the U disk permissions to allow only the current account (LCR) Full Control. Now open Notepad to enter the following and save it as a lock.bat batch, placed in the C: Table of contents.

REM Note: To access the USB disk, please run the desktop "Open u Disk" and enter the correct password

@cacls J:/e/r LCR

@pause

Command explanation: Run the cacls command to modify the J: (U disk) permission to deny LCR access.

Now, set up a batch Unlock.bat and send it to the desktop, whose shortcut name is "Open u Disk", which reads as follows:

@echo off

@runas/USER:LCR "cacls J:/g Lcr:f"

Command explanation: Re-run the cacls command with LCR to give LCR Full control of the U disk.

Step 2: Run TweakUI, expand My Computer → AutoPlay, and then check the "Activate removable media autoplay" option under Type. Click Create in the action item, and then follow the prompts to create a new AutoPlay interface called "Access U Disk", click "Change Program", select "C:lock.bat", and check "mixed content" in the supported media list. Because the system is automatically detected by the file type to pop up the playback window, so before we put in the U disk image and music files, so the system will detect its mixed content, and automatically execute the Lock.bat file, cancellation of LCR access rights.

Step 3: Right click on the U disk Select "Properties", in the open window, click the AutoPlay tab, then select "Mixed Document", then select "Select an action to perform" item in the Action Bar, and select "Access Disk" in the list.

After the above settings, when the U disk is plugged into the computer, the system runs the Lock.bat batch, which sets the current user permissions to deny access. And if you want to access the U disk, you can run the desktop "Open u Disk" shortcut, because the "runas" command needs to enter the password, which is equal to clever for the U disk set up a protection password.

        Note : more Wonderful tutorials please focus on the Triple computer Tutorials section, triple Computer office group: 189034526 Welcome to join

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.