- @echo off
- REM **********************************************************************************
- REM 管理员权限
- >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
- if '%errorlevel%' NEQ '0' (goto UACPrompt) else ( goto gotAdmin )
-
- REM **************************************
- :UACPrompt
- echo uac
- 1pause
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- exit /B
-
- REM **************************************
- :gotAdmin
- echo got
- 1pause
- if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
- REM **********************************************************************************
- REM 代码
-
- echo %cd%
- echo %~dp0
- cd /d %~dp0
- 1pause
- cls
-
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /f /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0
- reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /f /v EnableLUA /t REG_DWORD /d 0
- reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /f /v EnableLUA /t REG_DWORD /d 0
- echo ;win10关闭用户帐号控制通知-关闭UAC >nul 2>nul
-
-
- echo okokokok
- pause
- exit
复制代码
|