My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
Posts: 26 Joined: 1-May 18 ![]() | Does anyone know how to access/open what used to be a Control Panel (CPL) object “Windows Update” - in Windows 10… in code? Although this is utilised in an installer for an Access database project which is written in VB.NET - after the Access 2016 runtime is installed, I have found that programmatically downloading the required updates (about 30) takes an absolute age so I would like the users to be able to observer whats happening as in Windows 10. I can easily do this in Windows 7 but not 10. Is this even possible? Developed on a Windows 7 machine for installation in 7 and 10. Many thanks. |
![]() Post#2 | |
![]() UtterAccess Administrator Posts: 10,281 Joined: 7-December 09 From: St. Augustine, FL ![]() | Hi - try shelling the appropriate command: CODE Function OpenControlPanelUpdates() Shell "control update" End Function hth -------------------- |
![]() Post#3 | |
Posts: 26 Joined: 1-May 18 ![]() | Jack, I've been searching for this command for ages... Much appreciated, thanks a lot. Dave. |
![]() Post#4 | |
![]() UtterAccess Administrator Posts: 10,281 Joined: 7-December 09 From: St. Augustine, FL ![]() | No problem. I was surprised it took me me quite a few tries as well to find the one that worked. Cheers, -------------------- |
![]() Post#5 | |
Posts: 26 Joined: 1-May 18 ![]() | This may be of interest to someone concerning performing the same function as the VBA call to open the control Panel item Windows Update, Shell “control update”. This works in Windows 10 (from a VBA app) because the operating system “Shims” the call as Windows 10 Update is no longer in control panel but settings. Below is the process in VB.NET that does the same thing: - Dim Ops As String = My.Computer.Info.OSFullName.ToString Dim SysDrive As String = Environment.GetEnvironmentVariable("SystemDrive") If InStr(Ops, "Windows 10") Then Process.Start("" & SysDrive & "\Windows\explorer.exe", "ms-settings:windowsupdate") Environment.Exit(0) End If |
![]() Post#6 | |
![]() UtterAccess Moderator Posts: 11,914 Joined: 6-December 03 From: Telegraph Hill ![]() | So, if you want to do the same thing from VBA you can use: CODE Shell "explorer.exe ms-settings:windowsupdate", vbNormalFocus Or, if you want to grab the process id in case you want to close the window programtically, you can use: CODE Dim PID As Long PID = Shell("explorer.exe ms-settings:windowsupdate", vbNormalFocus) ' Use taskkill with PID to end process -------------------- Regards, David Marten |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 13th December 2019 - 09:52 PM |