|
本帖最后由 窄口牛 于 2021-12-10 20:05 编辑
- @echo off
- Setlocal enabledelayedexpansion
- reg query HKU\S-1-5-20>nul || echo;CreateObject^("Shell.Application"^).ShellExecute "%~f0", "", "", "runas", 1 > "%temp%\getadmin.vbs" && cscript //b "%temp%\getadmin.vbs" && exit /b & del "%temp%\getadmin.vbs" /f /q>nul 2>nul
- pushd "%CD%"&& CD /D "%~dp0"
- del %temp%\temp.txt /s /q>nul 2>nul
- del %temp%\guid.txt /s /q>nul 2>nul
- for /f "tokens=1-3 delims=}" %%a in ('reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} /f "*连接*" /s^|find ""') do echo %%a}%%b}>>%temp%\temp.txt
- for /l %%a in (1,1,2) do (for /f "tokens=1-3 delims=}" %%a in ('reg query HKEY_LOCAL_MACHINE\SYSTEM\ControlSet00%%a\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} /f "*连接*" /s^|find ""') do echo %%a}%%b}>>%temp%\temp.txt)
- )
- for /f "tokens=1,2 delims==" %%a in ('wmic nic get GUID /value^|findstr "{"') do echo %%b>>%temp%\guid.txt
- for /f "delims=" %%a in ('type %temp%\temp.txt^|findstr /v /g:%temp%\guid.txt') do reg delete %%a /f
- del %temp%\temp.txt /s /q>nul
- del %temp%\guid.txt /s /q>nul
- pause>nul
复制代码
删除多余网络连接.rar
(625 Bytes, 下载次数: 35)
|
|