I'm having problems helping a client with their PC. I'm trying to install all available important updates using TeamViewer, but I have to continuously restart before it will check for more updates. Then, I have to call them back and ask to reconnect to TeamViewer. I'm trying to be able to do this process unattended. I think the best way to do so is with a Visual Basic script. How can I instruct the computer to check for updates, install all important updates, restart, and check again, until all important updates are installed? The script needs to be able to run on startup and delete itself after completion. I'm not sure how to do this.
1 Answer
Recently, I did something very similar for my work (maintaining a fleet of Virtual Machines). I can't give out the direct source for it, since they own it. But the API for windows to do this is WUApi.dll
(iirc it's in %SystemRoot%\WUApi.dll
).
For a usage example, see this stack overflow post.
You may also want the Microsoft Reference Page.
WUApi.dll
. Here is an example of use.