Please Help Me Undo This Crazy Anti Auto Update Batch File


  1. Posts : 11
    Windows 10 Pro
       #1

    Please Help Me Undo This Crazy Anti Auto Update Batch File


    Please excuse me for posting hastily right after registration, it's not elegant, but I'm in dire need of help after hours of manual operations

    Basically, someone borrowed my computer and executed this batch file without asking me first. Could you please help me undo it? I'm a long time Windows user and can understand the smaller part of it, so I went into registry to configure Windows Update keys, reset my firewall rules to default, restarted the auto update services, etc. I also checked my local policies, and all items related to Windows update are "Not configured." Other than those, I had no idea or experience with "ACL"...

    The task is not completed so far, since in the Windows Update setting, it still shows "some settings are managed by your organization". I am the administrator and the only user of this computer so this is not necessary to say the least.

    Anyway, after hours of trying to manually correct the settings, I finally had enough and searched very hard to find the original batch file texts online. I wonder if this could finally end my misery of this morning. Would it be possible to create a batch file that exactly reverse this process?

    Thank you so much for your help! Please see the codes quoted below.

    Code:
    @echo off
    title BLOCK Win10AU!
    mode con cols=70 lines=15
    color 1f
    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                            
    echo ※                  Stopping Process...            
    echo ※                             
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    
    taskkill /im Windows10UpgraderApp.exe 2>nul
    del /f /q "%USERPROFILE%\Desktop\Windows 10 Update Assistant.lnk" 2>nul
    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                  
    echo ※           Adding firewall rules...   
    echo ※                   
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    
    netsh advfirewall firewall add rule name="Block_Windows10UpgraderApp" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\Windows10UpgraderApp.exe" action=block
    netsh advfirewall firewall add rule name="Block_WinREBootApp32" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\WinREBootApp32.exe" action=block
    netsh advfirewall firewall add rule name="Block_WinREBootApp64" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\WinREBootApp64.exe" action=block
    netsh advfirewall firewall add rule name="Block_bootsect" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\bootsect.exe" action=block
    netsh advfirewall firewall add rule name="Block_DW20" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\DW20.EXE" action=block
    netsh advfirewall firewall add rule name="Block_DWTRIG20" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\DWTRIG20.EXE" action=block
    netsh advfirewall firewall add rule name="Block_GatherOSState" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\GatherOSState.EXE" action=block
    netsh advfirewall firewall add rule name="Block_GetCurrentRollback" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\GetCurrentRollback.EXE" action=block
    netsh advfirewall firewall add rule name="Block_HttpHelper" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\HttpHelper.exe" action=block
    netsh advfirewall firewall add rule name="Block_UpdateAssistant" dir=in program="%SYSTEMROOT%\UpdateAssistant\UpdateAssistant.exe" action=block
    netsh advfirewall firewall add rule name="Block_UpdateAssistantCheck" dir=in program="%SYSTEMROOT%\UpdateAssistant\UpdateAssistantCheck.exe" action=block
    netsh advfirewall firewall add rule name="Block_Windows10Upgrade" dir=in program="%SYSTEMROOT%\UpdateAssistant\Windows10Upgrade.exe" action=block
    netsh advfirewall firewall add rule name="Block_UpdateAssistantV2" dir=in program="%SYSTEMROOT%\UpdateAssistantV2\UpdateAssistant.exe" action=block
    netsh advfirewall firewall add rule name="Block_UpdateAssistantCheckV2" dir=in program="%SYSTEMROOT%\UpdateAssistantV2\UpdateAssistantCheck.exe" action=block
    netsh advfirewall firewall add rule name="Block_Windows10UpgradeV2" dir=in program="%SYSTEMROOT%\UpdateAssistantV2\Windows10Upgrade.exe" action=block
    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                                 
    echo ※                 Configurating ACL...            
    echo ※                                     
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    
    echo y|cacls C:\Windows\UpdateAssistant\*.exe /t /p everyone:n 2>nul
    echo y|cacls C:\Windows10Upgrade\*.exe /t /p everyone:n 2>nul
    echo.
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                                 
    echo ※          Disable Windows Update               
    echo ※                               
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    
    net stop wuauserv
    sc config wuauserv start= disabled
    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                         
    echo ※                  Delete task...           
    echo ※                      
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    
    schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistant" /f 2>nul
    schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantAllUsersRun" /f 2>nul
    schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantCalendarRun" /f 2>nul
    schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantWakeupRun" /f 2>nul
    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                     
    echo ※                 Editing Registry...           
    echo ※                    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    
    del /q /f %SYSTEMDRIVE%\NAU.reg 2>nul
    echo Windows Registry Editor Version 5.00 >> %SYSTEMDRIVE%\NAU.reg
    echo.>> %SYSTEMDRIVE%\NAU.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]>> %SYSTEMDRIVE%\NAU.reg
    echo "DoNotConnectToWindowsUpdateInternetLocations"=dword:00000001 >> %SYSTEMDRIVE%\NAU.reg
    echo.>> %SYSTEMDRIVE%\NAU.reg
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]>> %SYSTEMDRIVE%\NAU.reg
    echo "NoAutoUpdate"=dword:00000001>> %SYSTEMDRIVE%\NAU.reg
    REG IMPORT %SYSTEMDRIVE%\NAU.reg
    del /q /f %SYSTEMDRIVE%\NAU.reg 2>nul
    
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    echo ※                                               
    echo ※                       All Done!               
    echo ※                                                
    echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※
    pause
      My Computer


  2. Posts : 34,900
    Win 10 Pro (1903) (2nd PC is 21H2)
       #2

    The easiest- if it works- would be to use a System Restore point created before this was executed.

    Failing that, if you use disk imaging, as is very frequently recommended here, you could restore a disk image. (E.g. Macrium Reflect (free) + external storage for images).
      My Computers


  3. Posts : 11
    Windows 10 Pro
    Thread Starter
       #3

    I would definitely do that if I had one, but unfortunately I've been too lazy to do backups
      My Computer


  4. Posts : 24,545
    10 Home x64 (21H2) (10 Pro on 2nd pc)
       #4

    cs4win10 said:
    I would definitely do that if I had one, but unfortunately I've been too lazy to do backups
    Welcome to TenForums @cs4win10

    A restore point is not a backup you have to remember to do for yourself. If System Protection is turned on (it often is) then a restore point is created automatically at each windows update and often automatically at intervals after that.

    See Option Two in this tutorial for how to check if you have any restore points, and how to restore one if you do.

    System Restore Windows 10 | Windows 10 Tutorials

    Note that system restore is not always successful, but it's safe to try because if it fails then it makes no changes.
      My Computers


  5. Posts : 11
    Windows 10 Pro
    Thread Starter
       #5

    Ah now I see. I do have a point of about 24 hours ago, but I installed and configured a critical software last night which is said to be affected by this restore, so I'm still trying to avoid the restore. If all the attempts fail to fix this disaster, I guess I would have to at the end =(
      My Computer


  6. Posts : 17,247
    Windows 11 Pro
       #6
      My Computer


  7. Posts : 11
    Windows 10 Pro
    Thread Starter
       #7

    I think I've got it working. After several reboots and gpupdate the original warning is gone, replaced by "active hour" policy notice, and now completely gone. I've also gone through the command again, the only thing I couldn't (un)do is this part, because the folders do not apply to my system.
    Code:
    cacls C:\Windows\UpdateAssistant\*.exe /t /p everyone:n
    echo y|cacls C:\Windows10Upgrade\*.exe
    Now I'm learning to mount that desired restore point and save it as an image for future use, so that it doesn't get replaced by the future points.

    That said, I'm still very interested to see a "counter" batch file for these codes for the sake of technicality.
      My Computer


  8. Posts : 24,545
    10 Home x64 (21H2) (10 Pro on 2nd pc)
       #8

    cs4win10 said:
    Now I'm learning to mount that desired restore point and save it as an image for future use, so that it doesn't get replaced by the future points.
    Restore points can be unreliable. They may fail to restore just when you need them the most. The most reliable way to go back to an earlier system is to save a system image onto an external drive. Most here recommend Macrium Reflect Free for that.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 02:18.
Find Us




Windows 10 Forums