Avoid downloading updates while USB tethering

5

1

I'm travelling seldom, so I hardly need data exchange via mobile phone. I have a contract which has 100 MB of traffic included, which is really sufficient for checking emails and browsing the web.

However, it regularly happens (like today) that Windows downloads updates via that connection. Today there were 12 updates for me, 72 MB. I get informed via SMS by my service provider that my traffic has almost been used. Unfortunately, I don't remind myself disabling Windows Updates.

Is there a way of detecting whether a USB tethering connection is active so that I could disable Windows updates automatically?

I'm not necessarily looking for a complete script, just the concept would be ok. I can do some scripting by myself.

I have tried:

Looking up the connection in ipconfig /all, but I noticed it creates a new entry every time, currently it`s called "Network connection 3".

Thomas Weller

Posted 2014-06-11T06:09:05.347

Reputation: 4 102

Could you look at the Windows Firewall settings (the in depth interface where you can define your own rules) to define a rule for the USB adapter your phone creates on Windows to block Windows Update ports (outbound) so the updater can't check; and thus download. – Kinnectus – 2014-06-11T07:06:25.877

What's the connection name when you're not tethering? Is it always the same? – and31415 – 2014-06-11T07:44:31.657

@and31415: that's a good point. I can possibly limit that to a number of networks I often use. – Thomas Weller – 2014-06-11T08:18:15.443

@BigChris: didn't even know that there is this advanced setting. I need to get familiar with it, check how it works and see whether it can help me. – Thomas Weller – 2014-06-11T08:19:26.137

1In order to differentiate between tethering/non-tethering connections you need to ensure there are certain patterns or conditions which are always true or false (e.g. a particular USB device being plugged in). – and31415 – 2014-06-11T08:40:34.387

Answers

3

This Answer won't appeal to everyone, but it may be the right answer for some:

Upgrade to Windows 8.

Windows 8 makes it easy to mark a network connection as a "metered connection", and by default, it won't download Windows updates over metered connections.

Spiff

Posted 2014-06-11T06:09:05.347

Reputation: 84 656

Indeed, doesn't appeal me. Anyway, good to know that this has been considered. – Thomas Weller – 2014-06-12T18:37:35.800

"There is one exception, [...] in the case of a critical security update to fix a worm-like vulnerability (e.g., a Blaster worm). In that case, Windows Update will download the update regardless of the network type." Source Also, under metered connections "[t]ile updates are limited to 50 MB per month." Source

– and31415 – 2014-06-14T22:27:44.770

1

Since you said you can do the scripting yourself... And based on what you said...

Your phone should show up under Portable Devices in Windows. Here is my iPhone:

enter image description here

If you right click the device and select Properties, then the Details tab, you can select Hardware IDs in the dropdown:

enter image description here

Using this PowerShell query (or whatever language you want), you can see all the USB devices attached to the machine in GridView:

gwmi Win32_USBControllerDevice -computername localhost | Out-GridView

enter image description here

Enter the part (or all) of the device ID in the filter of GridView:

enter image description here

And you will see that device is connected. Remove the phone and rerun the script. Those entries will be gone:

enter image description here

So you should be able to write a script that can search for those entries, and if the they are found, stop the windows update service.

Keltari

Posted 2014-06-11T06:09:05.347

Reputation: 57 019

1

Change your Windows Update settings to 'Check for Updates but let me choose whether to download and install them'. That will keep Windows from pulling the updates on it's own (it will still use some bandwidth to check for updates, but that should be minimal).

When it finds new updates, it'll prompt you to download & install them - if you are on metered service at the time, then you'll just tell it no and you come back to that when you are connected to cheap internet.

Michael Kohne

Posted 2014-06-11T06:09:05.347

Reputation: 3 808

1"Unfortunately, I don't remind myself disabling Windows Updates." Maybe it didn't become clear, that I know about this option. However, in most cases it's OK that Windows downloads automatically. – Thomas Weller – 2014-06-12T18:40:41.587