我们如果不想让别人在自己电脑上使用电脑用U盘的话,可以通过一段批处理来禁止电脑使用U盘,下面分享批处理禁止电脑使用 U盘代码,将文件保存到记事本,另存为bat文件即可。

禁止使用U盘代码如下
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
pause
要想恢复的话运行如下代码
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
@echo on
pause
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
@echo on
pause
本文地址:https://www.xiaoyaogzs.com/2875.html
关注我们:请关注一下我们的微信公众号:扫描二维码
,公众号:小姚户外
版权声明:本文为原创文章,版权归 小姚 所有,欢迎分享本文,转载请保留出处!
关注我们:请关注一下我们的微信公众号:扫描二维码

版权声明:本文为原创文章,版权归 小姚 所有,欢迎分享本文,转载请保留出处!
发表于2020-03-15 at 15:21 沙发
禁止使用U盘代码如下第一行代码是错的呀
@忘记了回忆感谢提醒,已修改
@小姚你回复后我刚进来看到是正确的了,可现在查看发现禁用和启用代码变成一样的了?
@忘记了回忆第一行代码不用应该也是可以的,所以去了
@小姚原来是这样,那一会我测试下,如果可以我也改下,谢谢你了哈
发表于2020-03-16 at 15:14 板凳
这个掌握了出去装逼![[嘻嘻]](https://www.xiaoyaogzs.com/wp-content/themes/Nana/images/smilies/2.gif)
发表于2020-03-16 at 15:34 地板
不用这么保护自己电脑吧
![[嘻嘻]](https://www.xiaoyaogzs.com/wp-content/themes/Nana/images/smilies/2.gif)
@叶先生博客个人电脑确实没必要