windowspowershellwindows-10registryapplication-settings

How to hide/disable a specific app desktop shortcut via the registry?


I have an app which has been deployed to various test devices.

The app installs and works but it also creates a desktop shortcut, in future installs I would like this to install without the shortcut.

Therefore, I would like to use the registry to hide/remove/disable the shortcut.

I have seen posts which state how to hide all apps using:

HideIcons"=dword:00000001

Would adding this key to my app registry work to hide this specific app icon only?


Solution

  • As far as I know there is no such option for single app to disable its shortcut via registry.

    BUT

    what you can do is install this application without giving a desktop shortcut (if it's an MSI) with property that handles no shortcut installation. It's been long time since I developed MSIs, so after digging up in a Google i found these properties:

    INSTALLDESKTOPSHORTCUT=""
    DISABLEDESKTOPSHORTCUT=1
    

    You might give them a try.

    What you can do instead is delete a shortcut from the desktop with PowerShell.

    $shortcuts = (Get-ChildItem 'C:\Users\XXXX\Desktop' | Where-Object Name -like "*.lnk")
    Write-Host "Found $($shortcuts.Length) shortcuts: $([string]::Join(", ", $shortcuts.Name))"
    
    $shortcuts.FullName | ForEach-Object {
        Remove-Item $_
    }
    

    PS. Might want to look at folder C:\Users\Public\Desktop too - there are shortcuts that are available for all users.