&pause > nul 2 >&1 &exit)Ĭmd /u /c echo Set UAC = CreateObject ^( 'Shell.Application ' ^) : UAC.ShellExecute ' %~0 ', ' %params% ', ' ', 'runas ', 1 > ' %temp%\getadmin.vbs ' &cscript //nologo ' %temp%\getadmin.vbs ' &exit If ' %1 ' = ' %params% ' (echo Elevating UAC for Administrator Privileges failed &echo Right click on the script and select 'Run as administrator' &echo Press any key to exit.
:: The following test is to avoid infinite looping if elevating UAC for Administrator Privileges failed
Set ' params =Problem_with_elevating_UAC_for_Administrator_Privileges ' &if exist ' %temp%\getadmin.vbs ' del ' %temp%\getadmin.vbs 'įsutil dirty query %systemdrive% > nul 2 >&1 & goto : GotPrivileges