下面两条代码分别恢复上面两种 bat 造成的影响,直接运行即可,其中 恢复 ezj 有窗口.bat 需要运行两次:
一、恢复 ezj 有窗口(运行两次)
@
echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
taskkill /f /fi "windowtitle eq 管理员: ezj 有窗口"
del /f/s/q ezj.txt
del /f/s/q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\ezj 无窗口.bat"
set n=1
:main
rd /s/q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\%n%"
rd /s/q "D:\%n%"
set /a n=n+1
goto main
二、恢复 ezj 无窗口
@
echo off
taskkill /f /fi "windowtitle eq ezj 无窗口"
del /f/s/q ezj.txt
set n=1
:main
rd /s/q "C:\ProgramData\%n%"
rd /s/q "D:\%n%"
set /a n=n+1
goto main
成品地址: https://c-t.work/s/d0ed28254cc145