Cmon now lol, I didnt know that you could download defender updates without wu service. So the script works great.
What about the BITS service? On 7 it is needed for windows update to return anything. It is present on 10 too. The script just keeps re-calling itself on 10 and popping up windows.
Same script works on windows 7. I literally copy and pasted the folder. Something goes wrong after it elevates on my 10 system. Heh, as to BiTS good to see pretty much nothing uses it but 2 games and some remote management apps. I can just add the extra lines. I don't leave anything that can download files in the background running except for eset. Completely removed defender already. edit: Its the net command that kicks off the loop. If I comment it out and run as admin the script works.
^^If the net command for the self elevation fails it's either the AV blocking access (JBenal reported it for Commodo Antivirus) or borked system files .
I tried "net session". It is dependent on the server service which I turned off since I don't share/serve anything.
Your system is borked. Change the line: net.exe session >nul 2>&1 && goto GotPrivileges to goto GotPrivileges and run as admin, like you said earlier.
Hi, Since the last CU, when I try to run the file, it runs CMD and enters in a loop of open CMD, close CMD, open CMD, close CMD. And I need to press Alt+F4 for close it. Is there any fix? Thanks
Delete or REM: Code: >nul 2>&1 (net.exe session || (cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "", "", "runas", 1 > "%temp%\getadmin.vbs" & cscript //nologo "%temp%\getadmin.vbs" & del /f /q "%temp%\getadmin.vbs" & exit)) Then run via right-click as admin.
Use the workarounds posted by rpo and s1ave77 until I install the Creators Update and make a proper fix. I've been putting off installing it because of the problems it causes. I'll try installing CU on my least used laptop sometime in the next few days and will have it worked out soon. Sorry for the inconvenience.
Or replace with : Code: set "params=Problem_with_elevating_UAC_for_Administrator_Privileges"&if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" fsutil dirty query %systemdrive% >nul 2>&1 || ( rem The following test is to avoid infinite looping if elevating UAC for Administrator Privileges failed 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 for exiting&pause>nul 2>&1&exit) cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "%~0", "%params%", "", "runas", 1 > "%temp%\getadmin.vbs"&cscript //nologo "%temp%\getadmin.vbs"&exit) If there is a problem when trying to elevate UCA, these instructions prevent an infinite loop. However the best solution is to start the script by "Run as Administrator", or if a shortcut is created, change the properties of the shortcut to start the script as admin. Assuming the script is run as administrator, it may been shortened this way : Code: sc config wuauserv start= auto & sc start wuauserv for /f "tokens=2 delims==" %%a in ('wmic cpu get AddressWidth /value') do (set arch=%%a) IF %arch% == 32 (set "wumt=%~dp0wumt_x86.exe") else (set "wumt=%~dp0wumt_x64.exe") Start "" /max "%wumt%" -update "-onclose sc stop wuauserv" "-onclose sc config wuauserv start= disabled" That's all folks.