Windows update + background processes - can I control?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
omar
Posts: 540
Joined: 22 Oct 2015, 17:56

Windows update + background processes - can I control?

Post by omar » 17 Apr 2018, 06:12

I connect to the Internet by tethering my mobile.
45 minutes surfing - Gmail, eBay, amazon - nothing else at all. I somehow use up 300mb data. :(

I've been told it's Windows 10 at fault. Updates and background processes. This happens EVERY time I connect. (Which didn't really make sense to me)

I can change a few settings to turn most things off. Which is great.
But then I want important things turned back on when I am back on broadband.

Is there an ahk script that does this turning off and on?

Thanks

vikcode

Re: Windows update + background processes - can I control?

Post by vikcode » 17 Apr 2018, 06:52

omar wrote:I connect to the Internet by tethering my mobile.
45 minutes surfing - Gmail, eBay, amazon - nothing else at all. I somehow use up 300mb data. :(

I've been told it's Windows 10 at fault. Updates and background processes. This happens EVERY time I connect. (Which didn't really make sense to me)

I can change a few settings to turn most things off. Which is great.
But then I want important things turned back on when I am back on broadband.

Is there an ahk script that does this turning off and on?

Thanks
could also be that your machine is part of a bot network

omar
Posts: 540
Joined: 22 Oct 2015, 17:56

Re: Windows update + background processes - can I control?

Post by omar » 17 Apr 2018, 17:42

oh :(
i'm not sure.
i have the same characteristics on 2 laptops.

i am very very very very careful about what i install.

i have kaspersky - so have russian mafia looking after me, so no way of being hijacked.
(apart from kaspersky hijacking the WHOLE laptop while it downloads an update when first turned on - laptop is unusable for a good 5 minutes)

RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Windows update + background processes - can I control?

Post by RickC » 17 Apr 2018, 19:50

The simple answer is YES, you can control Windows Update and its related services. Just be aware that Microsoft interrogates your devices and, if it finds you have fiddled with the defaults, will often return them to the defaults.

Windows Update - as the umbrella term - consists of four services if you are up-to-date, i.e. using Windows 10 version 1709. (Only 3 services were involved prior to the first Creators Update [which added the Update Orchestrator Service]... who knows what 1803 will bring.).
  • Windows Update (wuauserv)
    Delivery Optimization (dosvc)
    Update Orchestrator Service (UsoSvc)
    Background Intelligent Transfer Service (bits)
The Delivery Optimization service (also known as WUDO) has replaced the BITS service but BITS remains as a fallback service for times when WUDO is not working/available. WUDO is Microsoft's peer-to-peer (P2P) service that - by default - downloads and uploads updates from the internet and peers on the same network. It does this presumably to save Microsoft money by reducing the amount of Microsoft's own bandwidth. [Note: In practice Microsoft has farmed out its download operations to Akamai and other CDNs (Content Delivery Networks). If you want an eye-opener, just run SysInternals' TCPView (https://docs.microsoft.com/en-us/sysint ... ds/tcpview) or Nir Sofer's CurrPorts (https://www.nirsoft.net/utils/cports.html) when your Win 10 device is connected to the internet and supposedly doing nothing.].

First task - Turn off MS' P2P default to stop uploading updates to other devices on the internet (and local network):

You can do it with a REG file:

Code: Select all

Windows Registry Editor Version 5.00
; Uploading of Windows Updates-Turn OFF

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config]
"DODownloadMode"=dword:00000000

Or use AHK:

Code: Select all

; Uploading of Windows Updates (both LAN and Internet) using built-in P2P service - Turn OFF
RegWrite, REG_DWORD, HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config, DODownloadMode, 0
Second task - Turn off MS' Connected User Experiences and Telemetry service (diagtrack). This is the service that tells on you... constantly. You can disable it with a REG file but this doesn't stop it. Better to use a BAT file or AHK:

Code: Select all

; Stop and disable DiagTrack
; This used to appear in Services as 'Diagnostics Tracking Service' but MS sneakily renamed it to 'Connected User Experiences and Telemetry' (default = Automatic)
RunWait, sc stop "DiagTrack",,hide
RunWait, sc config "DiagTrack" start= disabled,,hide
Also, disable the associated scheduled tasks:

Code: Select all

RunWait,schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\Consolidator" /Disable,,hide
RunWait,schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\KernelCeipTask" /Disable,,hide
RunWait,schtasks /Change /TN "Microsoft\Windows\Customer Experience Improvement Program\UsbCeip" /Disable,,hide
RunWait,schtasks /Change /TN "Microsoft\Windows\Feedback\Siuf\DmClient" /Disable,,hide
RunWait,schtasks /Change /TN "Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload" /Disable,,hide
Third task - Stop and disable Windows Update and related services. I personally just disable the 4 services manually then use a BAT file to re-enable/disable them when required. The BAT file is as follows:

Code: Select all

REM Start Windows Update (wuauserv) and
REM Delivery Optimization (dosvc) and
REM Update Orchestrator Service (UsoSvc) and
REM Background Intelligent Transfer Service (bits)

sc config wuauserv start= auto
sc config UsoSvc start= auto
sc config dosvc start= auto
sc config bits start= auto
net start wuauserv
net start UsoSvc
net start dosvc
net start bits

REM Now run Windows Update and wait

control /name Microsoft.WindowsUpdate
pause

REM When finished, stop the services and disable them

net stop wuauserv
net stop UsoSvc
net stop dosvc
net stop bits
sc config wuauserv start= disabled
sc config UsoSvc start= disabled
sc config dosvc start= disabled
sc config bits start= disabled
Using the earlier example it should be easy to amend this to use AHK. Note that you'll need to elevate how you run the scripts (i.e. 'Run as administrator'), whether AHK, BAT or PowerShell... 'cos you're diddling with services (which are 'machine-wide', not 'user' based).

Be aware that some Microsoft Updates - e.g. KB4023057 specifically (see https://support.microsoft.com/en-in/hel ... date-relia)- will actively search out these tweaks and return them to Microsoft's defaults!

Note also that Windows Update (and related services) are not the only data slurpers. Microsoft assumes the whole world has 'always on' fast broadband with no data limits and configures Win 10 defaults accordingly. As a result you'll also need to look at the constant downloads of 'live tile' updates and profusion of advertised apps, i.e. MS' 'Suggestions'.

For the first you may be able to use this AHK code (I haven't tested it since Creators Update):

Code: Select all

; Live Tiles
; Disable Live Tile Push Notifications (0=Turn ON / 1=Turn OFF)
; Thanks to http://winaero.com/blog/disable-live-tiles-all-at-once-in-windows-10-start-menu/
RegWrite, REG_DWORD, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications, NoTileApplicationNotification, 1
; Clear Live Tile Notifications
; Thanks to http://winaero.com/blog/how-to-clear-live-tile-notifications-during-log-on-in-windows-10/
RegWrite, REG_DWORD, HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer, ClearTilesOnExit, 1
RegWrite, REG_DWORD, HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer, ClearTilesOnExit, 1
For the second, the following AHK code may still work. Again, I haven't tested comprehensively since Creators Update:

Code: Select all

; Disable App Suggestions in Start, i.e.'advertised' - Turn off machine-wide
; Thanks to https://blogs.technet.microsoft.com/mniehaus/2015/11/23/seeing-extra-apps-turn-them-off/
; Thanks to https://www.tenforums.com/tutorials/38945-enable-disable-app-suggestions-start-windows-10-a.html
RegWrite, REG_DWORD, HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent, DisableWindowsConsumerFeatures, 1

; Occasionally show suggestions in Start - Turn OFF
; Thanks to http://www.winhelponline.com/blog/how-to-disable-start-menu-ads-or-suggestions-in-windows-10/
RegWrite, REG_DWORD, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager, SystemPaneSuggestionsEnabled, 0

; Stop adverts on the Lock screen
; Thanks to http://www.howtogeek.com/243263/how-to-disable-ads-on-your-windows-10-lock-screen/
RegWrite, REG_DWORD, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager, RotatingLockScreenEnabled, 0
RegWrite, REG_DWORD, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager, RotatingLockScreenOverlayEnabled, 0
RegWrite, REG_DWORD, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, LockImageFlags, 0
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, CreativeId, 
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, PortraitAssetPath, 
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, LandscapeAssetPath, 
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, PlacementId, 
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, ImpressionToken, 
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, HotspotImageFolderPath, 
RegWrite, REG_SZ, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Lock Screen\Creative, CreativeJson,
Most of these tweaks involve RegWrite... so you'll also need to be aware of RegSetView, e.g.:

Code: Select all

; Allow registry commands in a 32-bit script to access redirected keys in the 64-bit registry view and vice versa.
; Thanks to qwerty12 (see https://autohotkey.com/boards/viewtopic.php?f=5&t=21292&p=102632#p102632)
SetRegView 64
Other tips:
- Use a local account, not a Microsoft account.
- Get rid of as many built-in apps as possible so they don't phone home.
- Turn off as many apps as possible that run, by default, in the background.
- If you don't use OneDrive then remove it completely (inc. from File Explorer) so it doesn't carry out its stupid check whether to sync.

Code: Select all

; Disable OneDrive integration
; Thanks to Shawn Brink (http://www.tenforums.com/tutorials/16278-onedrive-integration-enable-disable-windows-10-a.html)
; NOTE: Cannot re-enable unless you sign in to OneDrive (so I don't use this method)
; RegWrite, REG_DWORD, HKLM\SOFTWARE\Policies\Microsoft\Windows\OneDrive, DisableFileSyncNGSC, 1

; Remove OneDrive from File Explorer and stop it running from startup (alternative method)
If (A_Is64bitOS)
   {
   ; OS_is := "64-bit"
   RegWrite, REG_DWORD, HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}, System.IsPinnedToNameSpaceTree, 0
   RegWrite, REG_DWORD, HKCR\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}, System.IsPinnedToNameSpaceTree, 0
   RegDelete, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run, OneDrive
   }
Else
   {
   ; OS_is := "32-bit"
   RegWrite, REG_DWORD, HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}, System.IsPinnedToNameSpaceTree, 0
   RegDelete, HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run, OneDrive
   }
Hope this helps... sorry the info's not up-to-date but, to be honest, I think Windows 10 is not fit for purpose as an OS. MS now seems to actively fight against its user base and that's not where I want to be. I love AHK and will miss it dreadfully... but I'm spending more and more time immersing myself in Linux.

omar
Posts: 540
Joined: 22 Oct 2015, 17:56

Re: Windows update + background processes - can I control?

Post by omar » 19 Apr 2018, 18:45

@RickC
you are awesome mate.
are you sure you're not bill gates - and here to make up for the many holes in windows?
still going through the details and re-reading what you wrote.
THANKS.

timoshina
Posts: 67
Joined: 06 Jun 2017, 12:45

Re: Windows update + background processes - can I control?

Post by timoshina » 17 Jan 2019, 12:00

RickC wrote:
17 Apr 2018, 19:50
Wow dude, thank you very much! The best post I could find on the internet about win10 updates. Huge work, thanks! :thumbup:

rc76
Posts: 144
Joined: 07 Nov 2020, 01:45

Re: Windows update + background processes - can I control?

Post by rc76 » 14 Oct 2021, 22:16

Dear @RickC , do you know how we can deal with this Windows Update screen with ahk somehow?
00.png
00.png (375.97 KiB) Viewed 1177 times
I have used OOSU10.exe to turn off features related to Windows Update as much as possible, but this still pops out...

RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Windows update + background processes - can I control?

Post by RickC » 14 Oct 2021, 23:49

@rc76, Microsoft is absolutely determined to stop us tinkering with Windows Update (which it has every right to do, as the EULA only licenses us to use, not change Windows).

I haven't looked at this for a long time since so many things changed from the time I wrote my reply above back in 2018. If I remember correctly, some changes are:

1. Some registry entries for services related to Windows Update are now protected by a Security sub-key which must first be deleted before the Start entry of the service can be amended.

2. A Windows Remediation service checks regularly with Windows Update-related entries and reverts them to Microsoft's preferences if it detects that they have been amended. I haven't looked at this Remediation service for ages (as I just disable it) but realised that it's installed automatically if Microsoft detects you have been tinkering with Windows Update. Once installed, the Remediation service fires regularly to carry out its checks.

Note: The Remediation service apparently also reports home to the closest Microsoft hub from what I can tell of coincidental internet traffic (using Nir Sofer's CurrPorts for monitoring). I live in the UK and noticed a tiny 'heartbeat' pulse of traffic to Microsoft in Dublin in addition to the much longer established connection to Akamai in the Netherlands. [Akamai is a CDN used by Microsoft to offload the downloads of Windows Update payloads.].

3. Some registry entries changed to being owned by the built-in TrustedInstaller account. As a result, scripts affecting those entries need to be run elevated with the same TrustedInstaller (System) privileges. This is not insurmountable but is a pain to work around.

I stopped tinkering with Windows Update using AHK a while ago. The phrase is 'flogging a dead horse' (or 'loads of effort for very little or no reward'). I now use a tiny portable, freeware tool that just stops Windows Update in its tracks completely, including Remediation. With just one button it traverses all three of the minefields I mentioned above (and leaves me free to tinker with other aspects of Windows . :) )

The good news is that other background Windows services are still easy to manage using AHK. The bad news is that, increasingly, Microsoft is slowly locking more and more of them down to deter tinkering.

Hope this helps...
Last edited by RickC on 15 Oct 2021, 05:08, edited 4 times in total.

rc76
Posts: 144
Joined: 07 Nov 2020, 01:45

Re: Windows update + background processes - can I control?

Post by rc76 » 15 Oct 2021, 04:52

Thank you so much @RickC . Any chance you may share with us the freeware that you are using? That be super awesome and we can finally stop tinkering with Windows Update...

RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Windows update + background processes - can I control?

Post by RickC » 15 Oct 2021, 05:12

@rc76 ... gah, OK. Many people use Sordum.org's Windows Update Blocker.

Just be aware that Windows 11 has shown absolutely the direction that Microsoft continues to take in its quest to achieve the same monetary benefits as Apple's walled gardens, yet without Apple's apparent benevolence in continuing to let us amend the little stuff to our own benefit or pleasure.

I use Windows, macOS and Linux platforms... and know which direction lets me echo Mel Gibson's 'Braveheart' cry for 'freedom'. Hint... it's neither Microsoft nor Apple.

rc76
Posts: 144
Joined: 07 Nov 2020, 01:45

Re: Windows update + background processes - can I control?

Post by rc76 » 15 Oct 2021, 12:05

Thank you so much @RickC !

Absolutely agree with you, Linux is best in having control, but there are softwares that just not available on Linux as compared to Windows. :(

Post Reply

Return to “Ask for Help (v1)”