|
|
大佬, 批处理提取代码是这一段吗? 如果是,好保存一下- @echo off
- if /i "%UserName%" == "SYSTEM" (Goto GotAdmin) else (reg query "HKLM\SYSTEM\ControlSet001\Control\MiniNT" 1>nul 2>nul&&Goto GotAdmin)
- :BatchGotAdmin
- Set _Args=%*
- if `%1` neq `` Set "_Args=%_Args:"=""%"
- if exist %WinDir%\System32\fltMC.exe fltMC 1>nul 2>nul||(echo CreateObject^("Shell.Application"^).ShellExecute "cmd.exe","/c """"%~f0"" %_Args%""",,"runas",1 >"%TEMP%\getAdmin.vbs"&(CScript 1>nul 2>nul&&CScript //nologo "%TEMP%\getAdmin.vbs" 1>nul 2>nul||"%TEMP%\getAdmin.vbs" 2>nul)&del /f /q "%TEMP%\getAdmin.vbs" 2>nul&Exit /b)
- :GotAdmin
- Pushd "%CD%"&cd /d "%~dp0"
- Setlocal EnableDelayedExpansion
- if `%1` neq `` Set "Input=%~1"&Goto Start
- Set n=0&for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist "%%i:\Windows\System32\Config\SOFTWARE" if exist "%%i:\Windows\System32\Config\SYSTEM" Set /a n+=1&Set dsk!n!=%%i
- if !n! == 1 (Set Input=!dsk1!&Goto Start) else Exit /b
复制代码
|
|