@echo off>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"if '%errorlevel%' NEQ '0' (goto UACPrompt) else ( goto gotAdmin ):UACPromptecho Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs""%temp%\getadmin.vbs"exit /B:gotAdminif exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )pushd "%CD%"CD /D "%~dp0"echo Yes | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters /v SMBDeviceEnabledif exist "%windir%\SysWOW64" (reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters /t REG_QWORD /v SMBDeviceEnabled /d 0)if not exist "%windir%\SysWOW64" (reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters /t REG_DWORD /v SMBDeviceEnabled /d 0)sc stop LanmanServersc config LanmanServer start= disabledecho 445端口病毒修复脚本执行完成,重启后所有更改生效,回车退出脚本程序。pause其实不用关闭445端口也可以防御永恒之蓝(WannaCry)
保存.bat文件运行即可。