There are two ways to see the list of programs that automatically run during a startup, either reboot or log in. One in the Startup section under Apps in the Settings app and one in the Startup tab in Task Manager. You can disable any of the programs from automatically running in either place. And it’s fairly straightforward.
But it’s not so easy if you’d like to do it on a remote computer. Technically, you still can because all these startup programs are registered in the Registry that you can tweak.
Knowing that, we can make the process a lot easier with PowerShell.
Startup programs for all users
The registries that host all startup programs for all users are located at the following locations:
HKLM\Software\Microsoft\Windows\CurrentVersion\Run HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce
To query what’s listed there on a remote computer:
Invoke-Command -ComputerName $computer -ScriptBlock {
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
}
To disable any of them, you simply set a Binary value that is not zero in the following registry with the same name.
HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run
For example, to disable AdobeAAMUpdate-1.0 (Adobe Update Utility if you wonder what it is) from running in Startup,
Invoke-Command -ComputerName $computer -ScriptBlock {
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run -Name 'AdobeAAMUpdater-1.0' -Value ([byte[]](0x33,0x32,0xFF))
}
Now, as you can see, it’s disabled in Task Manager.
To reenable it, reset the registry value back to it’s original.
Invoke-Command -ComputerName $computer -ScriptBlock {
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run -Name 'AdobeAAMUpdater-1.0' -Value ([byte[]](0x02,00,00,00,00,00,00,00,00,00,00,00))
}
Startup programs for logged in user
For the Startup programs for the current user, basically just replace HKLM with HKCU.
To query the startup programs for the current login user,
Invoke-Command -ComputerName $computer -ScriptBlock {
Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
}
To disable any of these items, set a binary value (anything but 0) in the following registry location:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run
If you don’t see the program you’d like to disable on the list from these registry queries, it’s possible it’s existed in the Startup folder, which is a lot easier to navigate and remove them.
Last note
Lastly, thought to mention that in order to get the PowerShell scripts to work on remote computers there are two prerequisites that need to be met.
- WinRM needs to be enabled on the remote computer
- You need proper credentials to run the script on the remote computer.