杀毒论坛's Archiver

穷开心 发表于 2008-12-22 12:14

禁启用USB存储设备

<P>@echo off<BR>title 禁启用USB存储设备&nbsp; by 穷开心&nbsp; <A href="http://bbs.shadu007.com/">http://bbs.shadu007.com</A><BR>MODE con: COLS=80 lines=30<BR>color 3f<BR>:模式选择<BR>echo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ╭─────────────────────────╮&nbsp;&nbsp;&nbsp; <BR>echo.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ═┤&nbsp;&nbsp; [7]禁用USB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [9]启用USB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [0]退出&nbsp;&nbsp;&nbsp;&nbsp; ├═<BR>echo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ╰─────────────────────────╯<BR>echo.<BR>:loop<BR>SET /P Choice=&nbsp; 选择[7],[9],[0]按回车键继续……<BR>IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%<BR>IF /I '%Choice%'=='7' goto 禁用USB<BR>IF /I '%Choice%'=='9' goto 启用USB<BR>IF /I '%Choice%'=='0' goto 退出<BR>ECHO %Choice%&nbsp; 选择无效,请重新输入<BR>goto loop </P>
<P>:禁用USB<BR>echo off<BR>cacls %SystemRoot%\inf\usbstor.inf /e /c /d system<BR>cacls %SystemRoot%\inf\usbstor.inf /e /c /d "power users"<BR>cacls %SystemRoot%\inf\usbstor.inf /e /c /d users<BR>cacls %SystemRoot%\inf\usbstor.PNF /e /c /d system<BR>cacls %SystemRoot%\inf\usbstor.PNF /e /c /d "power users"<BR>cacls %SystemRoot%\inf\usbstor.PNF /e /c /d users<BR>cls<BR>@echo Windows Registry Editor Version 5.00&gt;&gt;%temp%\usb_temp.reg<BR>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]&gt;&gt;%temp%\usb_temp.reg<BR>@echo "Type"=dword:00000001&gt;&gt;%temp%\usb_temp.reg<BR>@echo "Start"=dword:00000004&gt;&gt;%temp%\usb_temp.reg<BR>@echo "ErrorControl"=dword:00000001&gt;&gt;%temp%\usb_temp.reg<BR>@echo "ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 00,52,00,2e,00,53,00,59,00,53,00,00,00&gt;&gt;%temp%\usb_temp.reg<BR>@echo "DisplayName"="USB Mass Storage Driver"&gt;&gt;%temp%\usb_temp.reg<BR>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security]&gt;&gt;%temp%\usb_temp.reg<BR>@echo "Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\&gt;&gt;%temp%\usb_temp.reg<BR>@echo&nbsp; 00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00&gt;&gt;%temp%\usb_temp.reg<BR>@echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Enum]&gt;&gt;%temp%\usb_temp.reg<BR>@echo "Count"=dword:00000000&gt;&gt;%temp%\usb_temp.reg<BR>@echo "NextInstance"=dword:00000000&gt;&gt;%temp%\usb_temp.reg<BR>cls<BR>regedit /s %temp%\usb_temp.reg<BR>del %temp%\usb_temp.reg<BR>goto :模式选择<BR>:启用USB<BR>echo off<BR>cacls %SystemRoot%\inf\usbstor.inf /e /p system:c<BR>cacls %SystemRoot%\inf\usbstor.inf /e /p "power users":c<BR>cacls %SystemRoot%\inf\usbstor.inf /e /p users:c<BR>cacls %SystemRoot%\inf\usbstor.PNF /e /p system:c<BR>cacls %SystemRoot%\inf\usbstor.PNF /e /p "power users":c<BR>cacls %SystemRoot%\inf\usbstor.PNF /e /p users:c<BR>echo Windows Registry Editor Version 5.00 &gt;c:\enableusb.reg<BR>echo. &gt;&gt;c:\enableusb.reg<BR>echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR] &gt;&gt;c:\enableusb.reg<BR>echo. &gt;&gt;c:\enableusb.reg<BR>echo "Start"=dword:00000003 &gt;&gt;c:\enableusb.reg<BR>regedit /s c:\enableusb.reg<BR>del c:\enableusb.reg <BR>goto :模式选择</P>
<P>[attach]41855[/attach]</P>

[[i] 本帖最后由 穷开心 于 2008-12-22 12:44 编辑 [/i]]

xianyutianji 发表于 2008-12-22 12:36

好方法 学习了

jimo007 发表于 2008-12-22 13:04

谢谢分享

sdfsfsdf123 发表于 2008-12-22 23:01

谢谢分享。

ftdw 发表于 2008-12-22 23:27

感谢楼主分享!:)

369241344 发表于 2008-12-22 23:28

都是批处理高手啊。

kk1551 发表于 2008-12-25 20:36

:D 好东西....顶........

leeyocen 发表于 2008-12-25 23:12

感谢楼主的分享

comma2008 发表于 2009-1-21 15:25

:luguo 感动啊 找到组织了

jlcclcb 发表于 2009-1-23 20:12

:handshake :handshake :handshake :handshake

ybzh007 发表于 2009-2-4 20:17

高手中的高手

bingbing520 发表于 2009-2-6 08:32

好东东顶你了,,,

sdnu 发表于 2009-2-6 09:25

感谢楼主分享

ufowwg 发表于 2009-3-14 09:08

:handshake 正好用得上,多谢

ffgg333 发表于 2009-3-19 07:45

不錯……正想找這個東東!!

害羞的杀手 发表于 2009-3-20 19:29

好东西....顶........

身影 发表于 2009-3-21 20:12

还不知道怎么用呢?学习!!一定要学习!!!!!!!!!!!!!:luguo :luguo :luguo

qft516 发表于 2009-3-27 17:26

好东西,正想要的

214065087 发表于 2009-4-3 12:16

学习一下,谢谢分享

1256 发表于 2009-4-7 21:34

感谢!

页: [1] 2

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.