โ12-04-2023 01:52 PM
Not quite a script, but a single Powershell line that I have autorun after agent install to help stop Windows from reinstalling forced, automatically installed, App Store applications. The biggest reason being that we had some machines that were installing the HP Smart (and I use the word smart with the largest air quotes I can manage) printer software simply because it detected an HP device on a network, in this case, a local coffee shop guest wifi.
I found that disabling the following reg key would stop it, so JC Commands and Powershell to the rescue!
Set-ItemProperty -Path 'HKCU:\\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' -Name SlientInstalledAppsEnabled -Value 0
Solved! Go to Solution.
โ12-16-2023 12:50 AM
I'm not sure why I did not realize that! simple fix ChatGPT writes really good PS so ask and you shall receive.
$registryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
$propertyName = 'SilentInstalledAppsEnabled'
$propertyValue = 0
# Check if the registry key exists
if (Test-Path -Path $registryPath) {
# Key exists, set the property
Set-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue
} else {
# Key does not exist, create the property (and key)
New-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue -PropertyType "DWORD"
}
โ12-05-2023 08:45 AM
@rlyons I just saw a reddit thread about this in r/sysadmin. Thank you for sharing the fix!
โ12-05-2023 11:11 AM
Aye. It's what made me think of it. I found this last year with one of our devices constantly installing the LenovoVantage app that automatically pushes and installs UEFI updates plus self installs on a clean system via this *insert quad letter word here*.
โ12-05-2023 11:34 AM
Gotta love an over enthusiastic auto install ๐ฌ๐๐ญ
โ12-05-2023 01:20 PM
I say class action lawsuit for false advertising. There is definitely NOTHING smart about HP.
Lenovo has better lawyers though with LenovoVantage. Someone was sharp enough to cover both bases because it is a DISadvantage.
โ12-06-2023 10:24 AM
For legal reasons I'll refrain from fuelling this fire but you do you, Rob ๐
โ12-07-2023 06:09 PM
LOL. I know printers are an easy target to poke at, but I also find it infinitely amusing that this article just posted today on ArsTechnica about a new marketing campaign in the EU for HP printers.... It's like, you don't even need to try anymore.
https://arstechnica.com/gadgets/2023/12/hp-misreads-room-awkwardly-brags-about-its-less-hated-printe...
โ12-15-2023 05:53 AM
๐
โ12-05-2023 01:01 PM
Added to policy! thanks Rob!
โ12-12-2023 01:51 AM
Has anyone tried to run this command? It fails for me on multiple systems with "Cannot find path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' because it does not exist." If I run it directly in PS on the system it completes its only when running it from JC commands that it fails. Any thoughts?
โ12-12-2023 11:29 AM
Just real quick, are you missing the second "\" in "HKCU:\\"? I notice it missing above, but that could have also just been the forum software messing up your formatting or a typo. Still, simple thing to double check.
โ12-15-2023 10:43 PM
I just ran the command on 7 PC's only 2 were successful the remaining failed with the same error.
Set-ItemProperty : Cannot find path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliv
eryManager' because
it does not exist.
At line:1 char:1
+ Set-ItemProperty -Path 'HKCU:\\Software\Microsoft\Windows\CurrentVers ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (HKCU:\Software\...DeliveryManager:String) [Set-Ite
mProperty], ItemNotFo
undException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand
โ12-15-2023 10:58 PM
So, the error is pretty obvious. For some reason that key doesn't exist on those systems. Question is why?
Better question... Anyone with better powershell script experience able to modify the script so it can check for the key, and if/then it so we create the key or modify based on the exists state?
โ12-16-2023 12:50 AM
I'm not sure why I did not realize that! simple fix ChatGPT writes really good PS so ask and you shall receive.
$registryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'
$propertyName = 'SilentInstalledAppsEnabled'
$propertyValue = 0
# Check if the registry key exists
if (Test-Path -Path $registryPath) {
# Key exists, set the property
Set-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue
} else {
# Key does not exist, create the property (and key)
New-ItemProperty -Path $registryPath -Name $propertyName -Value $propertyValue -PropertyType "DWORD"
}
New to the site? Take a look at these additional resources:
Ready to join us? You can register here.