question

TobyHarris-9880 avatar image
0 Votes"
TobyHarris-9880 asked Castorix31 edited

ms:settingswindowsupdate hidden/silent

Hi, I posted this question in another forum and was directed here, I hope this is the right place to ask this?

I am now so far out of my depth it's unreal!!

I am trying to find a way to run ms:settingswindowsupdate to check for updates and optional updates and install them, but all hidden or in the background. I know I can do this manually with check for updates, but I want to automate this process a little.

I have tried usoclient but it does not seem to work outside of task manager but if I create my own task it will not work at all. There is probably a very easy way to do this but I am pretty useless unfortunately, I want to avoid third party software.

I am working from home currently and have to keep logging in to work to make sure all updates are installed and everything is up to date. This I would think should be pretty easy but I can't believe how awkward it is proving. I really appreciate any help or advice you can give and I'm sorry if I have posed this in the wrong place.

Thanks Toby

windows-10-general
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I understand you are looking for some sort of automated method to check for update and if that is the case, Windows Update will check for update automatically once you connect to internet and you don't need to perform any task. You may do a quick test by connecting to internet and wait for a while and then check Windows Update and you will see update has been checked.
In addition, you may try the following command:

wuauclt /detectnow

0 Votes 0 ·

Hi,

Thank you, I want to be able to automate this process a little more regular than when Windows runs it! My PC's are on 24/7 and there are multiple updates per day.

I've tried the command you suggested in both Powershell and Admin Command Prompt both with no luck the Command Prompt gave the following error!

82882-screenshot.jpg



It say access is denied

Thank you

Toby

0 Votes 0 ·
screenshot.jpg (26.1 KiB)

There is a PowerShell Module called PSWindowsUpdate and you may import it using:

Install-Module PSWindowsUpdate

Then you may use the following commands:

Get-WindowsUpdate
Install-WindowsUpdate

Note that the module is from third-party, take a look at:

https://www.powershellgallery.com/packages/PSWindowsUpdate/





0 Votes 0 ·

Hi Reza-Ameri,

Ok it looks like I can't physically do this without a third party app, I have managed to get PSWindowsUpdate to work, but I am still back to my initial problem, running my .ps1 file silently and now with the added issue of needing to run Powershell as admin. Like I said originally I am a quite out of my depth with this now!

Many thanks for your continued help.

Toby

0 Votes 0 ·
Reza-Ameri avatar image
0 Votes"
Reza-Ameri answered

Welcome, the scenario is not available the way you are looking for and in any case you have to run it as administrator.
I would recommend you to open start and search for Feedback Hub app and open it and share a new suggestion and explain features you are looking for like what script would be solving your issue and request to add it to PowerShell or Command Prompt.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered

Ok it looks like I can't physically do this without a third party app

You don't need any 3rd party app to check/install Updates
You can use the WUA API with any language (C++, C#, VB, ...) or script
There ane many samples in MSDN, like Searching, Downloading, and Installing Updates


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TobyHarris-9880 avatar image
0 Votes"
TobyHarris-9880 answered Castorix31 edited

Hi,

Well 5 days and no luck, I have searched for C++ scripts to download but I can't find any that will do what I am looking for, so one final plea, can you point me in the direction of where I can get someone to help me write (well just write the script really) something that will do this, I haven't managed to compile the ones I've found!

I have searched for WUA API but have no idea how to get this to work in C++

Many desperate thanks

Toby

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have searched for WUA API but have no idea how to get this to work in C++

You just use Google with Keywords (like Interfaces names) and you will find many samples
(first returned : WinUpdateScan.cpp, among others...)
But it is simpler in VBS like the MS sample or in PowerShell



0 Votes 0 ·