bat 申请管理员cmd 不退出

完整代码

@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
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" )
cmd /E:ON /V:ON /F:ON /k "%1" %* 

设置代理

set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080

cmd不退出

cmd /E:ON /V:ON /F:ON /k "%1" %* 

你可能感兴趣的:(windows)