Stop Windows 10 Updates Properly and Completely

Page 4 of 37 FirstFirst ... 2345614 ... LastLast

  1. Posts : 16,938
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #31

    Like Matthew & some of the others, I have also relied on metered connections to avoid updates.
    - I have not messed with any services.
    - This has worked well.
    - I do also manually check each known network if I have to repeat the metered defaults because if I have fiddled with their metered settings individually beforehand they can stop falling into line with the default setting.
    - There were occasionally worrying 'last updated' indicators in Settings, Updates, WU so I have added in the withdrawal of permissions from usoclient.exe that is also described in this thread.
    - I have still never needed to alter any services.

    One of the benefits of the metered-connections-with-castrated-usoclient approach is that it is very easy to monitor and it does not change during a Windows session [updates that might change it do so during reboots].
    - I run an elevated TS task triggered by Log on [separate TS task for each user because it needs an interface to report problems].
    - If I have installed an update that has reset the default metered settings or usoclient ownership [set to Administrators as part of the permissions removal procedure given earlier in this thread], I get told within a few seconds of re/starting the computer.

    This is the heart of my monitoring batch file. I have removed most of the reporting bits & bobs because they would merely be a distraction but [26/4/18] have added in a very, very basic reporting mechanism so that you can see it all working.

    Code:
    :: This must be run as Admin
    prompt $g
    Title CriticalSystemChecks
    :: Check default metered settings
    Set MeteringOutputFile=%Temp%\%Random%-MeteredCheck.txt
    Set /a MeteringCounter=1
    Set MeteringAlarm=Off
    :CheckStatus
    :: Set parameter to examine for each loop
    If %MeteringCounter% EQU 1 Set MeteringCheck=WiFi
    If %MeteringCounter% EQU 2 Set MeteringCheck=Ethernet
    If %MeteringCounter% EQU 3 Set MeteringCheck=Default
    Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\DefaultMediaCost"  /t REG_DWORD | Find "%MeteringCheck%    REG_DWORD" >%MeteringOutputFile%
    set /p MeteringSetting=<%MeteringOutputFile%
    If not "%MeteringSetting:*x=%"=="2"  (Set MeteringAlarm=On) & GoTo EndMeteredCheck
    Set /a MeteringCounter=%MeteringCounter%+1
    If %MeteringCounter% LEQ 3 GoTo CheckStatus
    :EndMeteredCheck
    del %MeteringOutputFile%
    :: Report only if one or more are set to non-metered [i.e. their values were not 2 - this includes unexpected error values]
    If "%MeteringAlarm%"=="Off" GoTo FindUSOClientOwner
    Call :Reporting "Not all network types are metered"
    GoTo FindUSOClientOwner
    
    :FindUSOClientOwner
    Set /a OutputCounter=0
    Set Owner=
    For /F "usebackq tokens=4 " %%X in (`dir "%WINDIR%\System32\UsoClient.exe" /q`) Do Call :ExtractOwner %%X
    Set Owner=%Owner:*\=%
    If "%Owner%"=="Administrators" GoTo NFA
    Call :Reporting "USOClientOwner is not Administrators"
    GoTo NFA
    
    :ExtractOwner
    :: Capture line 3
    Set /a OutputCounter=%OutputCounter%+1
    If %OutputCounter% EQU 3 Set Owner=%1
    GoTo :EOF
    
    :Reporting
    :: This is normally a dialog box using variables set in each stage but mostly removed above to avoid distracting from the main point of the post
    Pause This is a very, very basic reporting tool - %1
    GoTo :EOF
    
    :NFA
    ::Pause at end during testing
    I hope this is useful,

    Denis
    Last edited by Try3; 25 Apr 2018 at 23:27.
      My Computer


  2. Posts : 7,606
    Windows 10 Home 20H2
       #32

    @ Try3: I manually changed the DWORD value of Default from 2 to 1 in DefaultMediaCost and then ran your script, but nothing happened.
      My Computer


  3. Posts : 16,938
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #33

    Matthew,

    No, nothing would. As I wrote above, the :Reporting section was removed to allow focus on the main point of the script.
    - Under :Reporting add a pause line so you can see that it works.
    - I've altered the script above to include this now.

    I did not want to get into a big debate about the merits of different ways of reporting back to the user.

    1 You could call a vbs procedure to bring up a MsgBox. I have posted each of my standard batch file [caller] and vbs file [callee] for MsgBox**, PopupBox** & InputBox.
    ** The first two include OnTheFly versions that require no calls to separate vbs files.

    2 You could use a host of special-purpose reporting tools. I use an hta procedure that is run by a batch file [caller] and VBS file [callee]. [Edited 11:18 BST Thursday 26th April 2018] I call it CustomMsgBox. The batch file, the VBS file, an explanatory document and some sample Taskbar icons for them are posted online for download in the same folder as the tools in para 1.

    Denis
    Last edited by Try3; 28 Apr 2018 at 09:49.
      My Computer


  4. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #34

    Here's a small freeware you guys might want to take a look ie. Stopupdates10:
    Download StopUpdates10 1.0.7

    One click to stop, one click to resume.
    Stop Windows 10 Updates Properly and Completely-p2.jpg
    Last edited by topgundcp; 25 Apr 2018 at 21:42.
      My Computer


  5. Posts : 7,606
    Windows 10 Home 20H2
       #35

    Try3 said:
    - Under :Reporting add a pause line so you can see that it works.
    With the added line, now there is a pause whether the DWORD values are 1 or 2.
      My Computer


  6. Posts : 16,938
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #36

    Matthew,

    1 You have set Wifi, Ethernet & Default to metered [2]?
    2 You have given ownership of usoclient to administrators [as part of disabling it using the procedure somebody posted earlier on in this thread]?
    3 You are running the batch file as admin? The FindUSOClientOwner section always fails if you do not do so.

    I ran this version of the batch file on my own computer to make sure that I had not made a mistake when chopping out the reporting subroutines. It works correctly.

    Try seeing what fails by taking out the :: on the last line so it waits for you to close it.

    Denis
      My Computer


  7. Posts : 16,938
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #37

    Matthew,

    I have added a very, very basic reporting mechanism to the :Reporting sub-routine and have also added arguments to both the Call :Reporting lines to support that.

    Denis
      My Computer


  8. Posts : 7,606
    Windows 10 Home 20H2
       #38

    Try3,

    I changed the display language from Chinese to English and rebooted it. Now there is no pause. Does that mean your script does not apply to Chinese?
      My Computer


  9. Posts : 16,938
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #39

    Matthew,

    I have not used it in anything other than an English-language computer and I know nothing of developing international versions.
    - Having said that, I read your earlier posts and thought the relevant parts would be the same.
    - I have always thought that the batch file commands themselves were the same in all language versions.

    In my English-language version -

    1 The metered settings key looks like this
    Stop Windows 10 Updates Properly and Completely-metered-settings-key.png
    so if yours has the same key path-name & displays the same values that part of it should work.

    2 The response to the core part of the USOClient check
    Code:
    dir "C:\WINDOWS\System32\UsoClient.exe" /q
    looks like this when entered in an Admin command window on its own
    Stop Windows 10 Updates Properly and Completely-usoclient-check.png
    so if your response has the same layout [BUILTIN\Administrators] & the same spelling of Administrators it should work

    2.1 Administrators is the name of the user group to which all admin-level user accounts belong. You can check the spelling in use on your computer by entering the command
    net user <YourAdminAccountUserName>
    then checking the spelling used on the Local Group Memberships line of the output
    Stop Windows 10 Updates Properly and Completely-netuser-username-localgroupmemberships.png

    2.2 The batch file lines
    Code:
    Set Owner=%Owner:*\=%
    If "%Owner%"=="Administrators" GoTo NFA
    remove the \ and everything before it from ... BUILTIN\Administrators then compare the remaining characters to the word "Administrators" because that is the ownership achieved by the first command in the procedure to remove permissions from USOClient.exe
    Code:
    takeown /f "%systemroot%\System32\UsoClient.exe" /a
    [see, for example, post #25 above]

    In case this does not resolve matters, I have posted a text file showing the whole progress of a successful run of the batch file. At which line do your results differ?

    Denis
    Last edited by Try3; 26 Apr 2018 at 05:27.
      My Computer


  10. Posts : 7,606
    Windows 10 Home 20H2
       #40

    When the display language is English, it shows the following:
    Stop Windows 10 Updates Properly and Completely-dword-english.jpg

    When the display language is Chinese, it shows the following:
    Stop Windows 10 Updates Properly and Completely-dword-chinese.jpg

    It is "Computer" in English, while it is "電腦" in Chinese. Could that be the problem?

    Try3 said:
    You can check the spelling in use on your computer by entering the command net user <YourAdminAccountUserName>
    The syntax of the command is incorrect. See below:
    Stop Windows 10 Updates Properly and Completely-net-user-youradminaccountusername.jpg
      My Computer


 

  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 09:33.
Find Us




Windows 10 Forums