Add Application to AppPath Using PowerShell

Thanks Jeff Scripter for this nugget: @JeffTheScripter

Why do this?  Because I want to press WindowsKey+R and type in the application and have it launch.  I don’t want to have to search the start menu, or the drive if there is no start menu shortcut.  I just want it to be in the path so it will launch in any context when I type the name.

For my Example, I’m going to use CMTrace, since I use it a ton, and when I type it in, and it doesn’t launch, I find it annoying that I have to type the pull path (c:\windows\ccm\cmtrace.exe)

image

Now also shows up when you search
image

What does it look like in the Registry?
image

Code:

New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" -Name 'cmtrace.exe' -ItemType Registry -ErrorAction SilentlyContinue
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cmtrace.exe" -Name '(Default)' -Value "c:\windows\ccm\cmtrace.exe" -ErrorAction SilentlyContinue
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cmtrace.exe" -Name 'Path' -PropertyType string -Value "c:\windows\ccm" -ErrorAction SilentlyContinue

 

If you want to add to your OSD or IPU TS so moving forward it’s there:
Run PowerShell Step:
image

 

Condition:

image

 

GARYTOWN.COM

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.