Disable and enable USB for XP

Source: Internet
Author: User

@ Echo off
: Start
Cls
Color
MODE con: COLS = 79 LINES = 25
Echo _____________________________________________________________________________
Echo was too busy to handle too many issues, too many issues were reported.
Echo. commandid
Echo. commandid
Echo disabled. Disable USB. Enable usb Z. Exit program disabled
Echo. commandid
Echo. commandid
Echo too many
Echo. please refer to the following link for more information:

: Cho
Set choice =
Set/p choice = enter the corresponding press Enter:
If not "% Choice %" = "" SET Choice = % Choice :~ 0, 1%
If/I "% choice %" = "1" goto guan
If/I "% choice %" = "2" goto kai
If/I "% choice %" = "Z" goto end
The echo selection is invalid. enter a new one.
Echo.
Goto cho

: Guan
@ Echo off
Reg add "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ StorageDevicePolicies"/v WriteProtect/t reg_dword/d 1/f
Reg add "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ USBSTOR"/v Start/t reg_dword/d 4/f
Copy % Windir % \ inf \ usbstor. inf % Windir % \ usbstor. inf/y> nul
Copy % Windir % \ inf \ usbstor. pnf % Windir % \ usbstor. pnf/y> nul
Del % Windir % \ inf \ usbstor. pnf/q/f> nul
Del % Windir % \ inf \ usbstor. inf/q/f> nul
Pause & exit
@ Echo on

: Kai
@ Echo off
Reg add "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ USBSTOR"/v Start/t reg_dword/d 3/f
Copy % Windir % \ usbstor. inf % Windir % \ inf \ usbstor. inf/y> nul
Copy % Windir % \ usbstor. pnf % Windir % \ inf \ usbstor. pnf/y> nul
Del % Windir % \ usbstor. pnf/q/f> nul
Del % Windir % \ usbstor. inf/q/f> nul
Pause & exit
@ Echo on

: End
Exit

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.