Build.bat
@echo off
echo Disabling UAC, please wait...
start DisableUAC.lnk
echo UAC Disabled Successfully!
echo.
pause
DisableUAC.bat:
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
To run DisableUAC.bat with administrative privileges, I created a shortcut DisableUAC.lnk and checked properties > shortcut > advanced and checked “Run as administrator.” Then I call for it inside Build.bat
This all works, but how can I get the command prompt that shows up from DisableUAC.bat to close upon completing the task? (keep the main Build.bat open, close the DisableUAC.bat that pops up)
Change
/kto/c:See
cmd /?:Although I don’t think you need to start a new cmd.exe at all here? I think this would also work, either directly as a shortcut or in DisableUAC.bat: