成长值: 255 签到天数: 4710 天 [LV.Master]伴坛终老
|
发表于 2018/3/16 21:36
|
显示全部楼层
|阅读模式
|Google Chrome 65.0.3325.146 |Windows 10
- @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" )
- pushd "%CD%"
- CD /D "%~dp0"
- ::-----------------------------------------------------------
- 这里写你的正常bat文件内容
- pushd
- ::-----------------------------------------------------------
- exit
复制代码
|
|