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