收藏 分销(赏)

USB权限控制.doc

上传人:xrp****65 文档编号:7693691 上传时间:2025-01-12 格式:DOC 页数:2 大小:25.50KB
下载 相关 举报
USB权限控制.doc_第1页
第1页 / 共2页
USB权限控制.doc_第2页
第2页 / 共2页
本文档共2页,全文阅读请下载到手机保存,查看更方便
资源描述
USB权限控制 1、首先,关闭USB存储设备的盘符自动分配,打开注册表,找到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR,将"Start"的值改为4(禁止自动启动),默认为3是自动分配盘符 2、干掉USB存储设备的作用文件:进入WINDOWS系统目录,找到X:\Windows\inf,这里说明一下,USB存储设备的作用文件有两个,分别是usbstor.inf和usbstor.pnf,因为后续可能需要重新打开USB功能,所以不要删除它,建议拷贝到其他位置,当然你要暴力一点,删除它也没关系,但记得做好备份。 我用两条批处理指令实现: 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 3、然后,禁止将电脑里的资料拷贝到USB存储设备,意思是把USB存储设备设置只读的,干成残废。 打开注册表:定位到HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Control,在其下新建一个名为“StorageDevicePolicies”的项,选中它,在右边的窗格中新建一个名为“WriteProtect”的DWORD值,并将其数值数据设置为1 批处理代码 关闭过程: @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 @echo on 开启过程: @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 @echo on 将以上代码保存为两个BAT文档,然后放进x:\Windows\system32\目录下,比如DisableUSB.bat和EnableUSB.bat 然后直接在运行里面输入指令:DisableUSB (关闭)EnableUSB(开启) 具体实施的过程可以使用以下批处理来完成! 将以下代码保存为Scan.Bat,将DisableUSB.bat放到与批处理同一文件夹执行即可。 代码解释:扫描局域网中的计算机,扫描范围包括:192.168.1.1~192.168.8.254,扫描数量共计2032个,扫描到存活的主机后将DisableUSB.bat拷贝到对方机器的C$系统共享目录(这个得保证是开启状态),然后执行 @echo off echo 操作成功的電腦IP包括:>E:\Success.txt for /l %%a in (1,1,8) do ( for /l %%b in (1,1,254) do ( ping -n 1 -w 50 192.168.%%a.%%b && net use \\192.168.%%a.%%b "password" /user:administrator && copy DisableUSB.bat \\192.168.%%a.%%b\C$\ Windows\System32\DisableUSB.bat && Start DisableUSB.bat>>E:\Success.txt ) )
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传
相似文档                                   自信AI助手自信AI助手

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服