求一个可以封杀USB接口的批处理
答案:2 悬赏:50
解决时间 2021-03-07 05:21
- 提问者网友:绿海猖狂
- 2021-03-06 15:34
求一个可以封杀USB接口的批处理
最佳答案
- 二级知识专家网友:木子香沫兮
- 2021-03-06 15:42
@echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ControlStorageDevicePolicies" /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
@echo on
新建一个文本文档,把以上复制并保存,然后修改后缀.txt为.bat
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ControlStorageDevicePolicies" /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
@echo on
新建一个文本文档,把以上复制并保存,然后修改后缀.txt为.bat
全部回答
- 1楼网友:时光挺欠揍
- 2021-03-06 17:20
1、禁用usb批处理:把下死文字保存为.bat文件,就成了禁用usb接口的脚本: @echo off copy %windir%\inf\usbstor.inf %windir%\usbstor.inf copy %windir%\inf\usbstor.pnf %windir%\usbstor.pnf del %windir%\inf\usbstor.inf del %windir%\inf\usbstor.pnf reg add "hkey_local_machine\system\currentcontrolset\services\usbstor" /v start /t reg_dword /d 4 /f echo on 2、启用usb批处理:把下死文字保存为.bat文件,就成了启用usb接口的脚本 @echo off copy %windir%\usbstor.inf %windir%\inf\usbstor.inf copy %windir%\usbstor.pnf %windir%\inf\usbstor.pnf reg add "hkey_local_machine\system\currentcontrolset\services\usbstor" /v start /t reg_dword /d 3 /f echo on 如果你的所有计算机都有同一个管理员,且密码相同,你还可以用下面的批处理远程检查一下是否禁用成功了 @echo off for /f "delims=" %%i in (c:\hosts.txt) do net use \\%%i\c$ "管理员密码" /user:"管理员用户名" & if errorlevel 1 ( echo %%i false>>c:\false.txt) else ( if exist \\%%i\c$\windows\inf\usbstor.inf (echo %%i false>>c:\false.txt ) else ( echo %%i successed>>c:\successed.txt) ) echo on
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯