Hkey local machine software microsoft windows currentversion app paths

Why can you start Mozilla Firefox by typing “firefox” in the Run dialog and press enter? Firefox.exe is not located in any directory in the path. The same with Outlook (type “outlook”), PowerShell (“powershell”), VMware Workstation (“vmware”) or Adobe Reader (“acrord32”). This “magic application starting thingy” works because of a little-known Windows feature based on […]

,
last updated October 24, 2013, in

Why can you start Mozilla Firefox by typing “firefox” in the Run dialog and press enter? Firefox.exe is not located in any directory in the path. The same with Outlook (type “outlook”), PowerShell (“powershell”), VMware Workstation (“vmware”) or Adobe Reader (“acrord32”). This “magic application starting thingy” works because of a little-known Windows feature based on the “App Paths” registry key.

App Paths – Dissection

In your forays through the Windows registry you may have noticed a peculiar key, HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionApp Paths, that has subkeys named like executables. Here is what it looks like on my machine:

Notice that the HKLM App Paths key and its counterpart in HKCU are basically mapping tables between executable names and their full paths. The direct subkeys of App Paths store the executable names, while each subkey’s default value stores the full path to that executable.

Notice also, that the key “firefox.exe” has a named value “Path” that stores the path to the program’s installation directory.

So what is this all about?

App Paths – Explanation

The App Paths key provides a mechanism that allows programmers to make their application startable by name only without having to modify the system-wide path.

Why would they do that? Vanity and overestimation of the importance of one’s own application. But, hey, it sometimes does come in handy to be able to start programs without having to type the full path, just hit Win+R instead and type the executable name.

Getting more technical, modifying the system path is not exactly best practice since it may slow down the system, break other applications and even create security holes. To provide an alternative, Microsoft added the App Paths functionality in XP. Whenever a new process is to be started with the API functions ShellExecute or ShellExecuteEx, and only a file name without a path is specified, Windows looks in the following places for the executable:

  1. The current working directory.
  2. The Windows directory.
  3. The WindowsSystem32 directory.
  4. The directories listed in the PATH environment variable.
  5. If there is a App Paths subkey with the name of the executable, the key’s default value is used as the program’s full path. If the subkey also has a value named Path, the string stored in Path is added to the PATH environment variable, but only for the process to be started.

As mentioned, the App Paths key has a second use, namely proving per-process PATH configurations, reducing the need of application developers to modify the global system PATH.

For further information and a list of other possible values please see the MSDN article Application Registration.

About the Author

Helge Klein (ex CTP, MVP and vExpert) worked as a consultant and developer before founding vast limits, the uberAgent company. Helge applied his extensive knowledge in IT infrastructure projects and architected the user profile management product whose successor is now available as Citrix Profile Management. Helge is the author of the popular tools Delprof2 and SetACL. He has presented at Citrix Synergy, BriForum, E2EVC, Splunk .conf and many other events. Helge is very active in the IT community and has co-founded Virtualization Community NRW (VCNRW).

Read more

Let’s say (Windows 10, 64-bit) I have a standalone exe file, c:exampleexample.exe — not installed with an installer, doesn’t have anything in the registry, just an exe file.

If I then go into the registry, and add a key «example.exe» to App Paths, and set its default value to the path (.reg file snippet):

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionApp Pathsexample.exe]
@="C:\example\example.exe"

What is different on my system now? What exactly can I do now that I could not do before I added that?

asked Apr 15, 2021 at 20:54

Jason C's user avatar

2

Nothing is different. If the program does not need to be installed with an installer, then there is no real point in adding a registry entry.

I have a number of these small programs and I just run them from the location they are stored in. So path not needed.

If you need a path to it, use Windows Environment variables to add the path. Advanced Windows Settings, Advanced Tab and click on Environment Variables. This will be preferable to a registry entry.

It may be preferable not to have a path so you can run the program from a USB Key or a different (non-OS) Drive.

answered Apr 15, 2021 at 21:03

John's user avatar

JohnJohn

41.7k2 gold badges30 silver badges53 bronze badges

Looks like it was a case of RTFM; I got a link to the documentation from this comment (thanks), so I figured I’d post a brief rundown. Check the MS docs for complete details.


The main purpose of «App Paths», as this answer hints at, is as an alternate place for per-app PATH entries (as opposed to the global user or system PATH entries). Also it specifies a couple of details for how Windows (particularly ShellExecute) deals with the program.

For my specific example, the only thing it does is specify the full path of «example.exe». There are probably a couple of effects here but one noticeable one is:

  • I can now type «example.exe», or even just «example», in Start → Run and it will run the application; I no longer have to specify the complete path (e.g. I don’t have to type out «c:exampleexample.exe»).

However, there are a few other values that can appear under the subkey, that affect various things:

  • Path specifies a list of paths that are added to the PATH environment variable when the application is run — I guess this is the main purpose of App Paths (hence the name).
  • DropTarget can be used to specify custom behavior when files are dragged onto the exe, as opposed to the default of just turning the filenames into command line parameters.
  • SupportedProtocols specifies if the application handles specific URL schemes.
  • UseUrl specifies if the application can deal with URLs instead of just local files, with the end effect being to allow for various optimizations such as Windows passing the URL of an internet resource to the application rather than downloading it locally first, etc.
  • DontUseDesktopChangeRouter is some setting that has something to do with avoiding file selection dialog deadlocks for debugger applications. It’s a very specific option.

That’s about it: paths, custom drag & drop behavior, URL handling, and a seemingly arbitrary hyper-specific debugger-related setting that I guess they couldn’t find a better place for (or it was an old high priority hot-fix and some poor MS dev was running on caffeine and fumes). It’s an odd little collection; but I’m sure there are historical reasons for everything there.

Programmers use Internet Explorer, a key programming component on Windows. So it is silly to use non windows programs.

Start chrome

Programs listed at HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionApp Paths can be started in the Windows’ shell by typing their name. In a console you can force executing via the shell by using start.

Note call all files something.exe but the actual file doesn’t need to be an exe.

So

Win.exe
    @="C:Windowswin.ini

when typing win it will open win.ini.


Path

Adding a common console program to the path allows you just to type the name.

From my PasteBin account https://pastebin.com/YKEmChkc this file

This batch file adds the folder the batch file is in to the user’s path for future command prompts

REM One file follows
REM _AddThisFolderToPath.bat
REM This batch file adds the folder the batch file is in to the user's path for future command prompts
REM If the folder is already in the user's path the command is ignored
Setx path "%path%;%~dp0"
REM Optional add to the current path setting
REM Set path "%path%;%~dp0"
Pause

In a command prompt type path /?, set /?, setx /?, ftype /?, assoc /?.

Also see the default search that CreateProcess uses.

1.The directory from which the application loaded.

2.The current directory for the parent process.

3.The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory.

  1. The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of
    this directory is System.

5.The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.

6.The directories that are listed in the PATH environment variable. Note that this function does not search the per-application path
specified by the App Paths registry key. To include this
per-application path in the search sequence, use the ShellExecute
function.


Start — All Programs — Accessories — Right click Command Prompt and choose Run As Administrator. Type (or copy and paste by right clicking in the Command Prompt window and choosing Paste). Type for table format

 wmic /output:"%userprofile%desktopWindowsInstaller.html" product get /format:htable

or in a form format

 wmic /output:"%userprofile%desktopWindowsInstaller.html" product get /format:hform

It will create a html file on the desktop.

Note

This is not a full list. This is only products installed with Windows Installer. There is no feature for everything.

However as I said in my previous post nearly everything is listed in the registry.

So to see it in a command prompt

  reg query HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall /s

or in a file

 reg query HKLMSOFTWAREMicrosoftWindowsCurrentVersionUninstall /s>"%userprofile%desktopWindowsUninstall.txt"

To see it in notepad in a different format

Click Start — All Programs — Accessories — Right click Command Prompt and choose Run As Administrator. Type Regedit and navigate to

 HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall

Right click the Uninstall key and choose Export. If you save as a reg file (there is also text file, they are slightly different text formats) you need to right click the file and choose Edit to view it.

To view Windows Updates

 wmic /output:"%userprofile%desktopWindowsUpdate.html" qfe  get /format:htable

.

Home
> OS Internals, Tech, Windows > The Windows “App Paths” Registry Key

This was news to me. Basically, not every app has to be on your PATH to be launched via executable name only (from anywhere).

For example, on my x64 Windows 7 machine, WordPad is located at:

<C:Program FilesWindows NTAccessorieswordpad.exe>

This is *not* set in my PATH environment variable. But I can go to Start > Run, and type wordpad, and it launches.

Why does this work? Because of “App Paths”.

<HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionApp Paths>

http://helgeklein.com/blog/2010/08/how-the-app-paths-registry-key-makes-windows-both-faster-and-safer/

Why can you start Mozilla Firefox by typing “firefox” in the Run dialog and press enter? Firefox.exe is not located in any directory in the path. The same with Outlook (type “outlook”), PowerShell (“powershell”), VMware Workstation (“vmware”) or Adobe Reader (“acrord32″). This “magic application starting thingy” works because of a little-known Windows feature based on the “App Paths” registry key.

Windows API developer Raymond Chen has more detail on the feature and history on why “App Paths” registry key was created in the first place.

http://blogs.msdn.com/b/oldnewthing/archive/2011/07/25/10189298.aspx

Also note that malware could use this as well. Raymond Chen clarifies it well:

Now, the intent was that the registered full path to the application is the same as the registered short name, just with a full path in front. For example, wordpad.exe registers the full path of %ProgramFiles%Windows NTAccessoriesWORDPAD.EXE.

But there’s no check that the two file names match. The Pbrush folks took advantage of this by registering an application path entry for pbrush.exe with a full path of %SystemRoot%System32mspaint.exe: That way, when somebody types pbrush into the Run dialog, they get redirected to mspaint.exe.

Ключи системного реестра

Отображение расширений файлов

По умолчанию для удобства работы Windows XP не отображает расширения для зарегистрированных типов файлов — пользователь идентифицирует тип файла по значку. Однако это удобно не во всех случаях, а кроме того учитывая поддержку двойных расширений и возможность присвоения файлу значка несвойственного данному типу файлов это представляет определенную угрозу безопасности (один из методов распространения вирусов — под видом файла со значком картинки пришедшего по почте пользователь запускает exe файл содержащий вирус).

Существует возможность отображать расширения файлов — в меню Проводника выберите пункт «Сервис — Свойства папки — Вид», и снимите флажок в пункте «Скрывать расширения для зарегистрированных типов файлов». Другой вариант — оставить отображение расширений по умолчанию (скрывать) а отобразить их лишь для некоторых файлов — в меню Проводника выберите пункт «Сервис — Свойства папки — Типы файлов», выделите тип файлов, расширение которых необходимо отобразить, нажмите кнопку «Дополнительно» и отметьте флажком пункт «Всегда отображать расширение». Однако этот способ не подходит для исполняемых файлов, поскольку они не отображаются в окне «Типы файлов». Чтобы всегда отображать расширения для исполняемых файлов, откройте редактор реестра, найдите раздел [HKEY_CLASSES_ROOTxxxfile] (где xxx — расширение исполняемого файла) и создайте пустой строковый параметр «AlwaysShowExt»

Редактируем пункт контекстного меню «Создать…»

Наверняка Вы используете в работе такую удобную функцию как использование пункта контекстного меню «Создать…» для создания новых файлов и папок. При установке новых приложений некоторые из них добавляют в это меню свои пункты, не всегда нужные пользователю и меню разрастается до внушительных размеров. В этом случае возникает необходимость удалить лишние пункты. А бывает ситуация когда было бы неплохо добавить свой пункт меню или изменить создаваемый документ по умолчанию в соответствии с текущими потребностями, например, чтобы система создавала не пустой текстовый файл при выборе «Создать — текстовый документ», а заготовку, содержащую определенный текст. Также изменение шаблонов по умолчанию удобно при создании типовых веб-страниц.

Параметры реестра, отвечающие за меню «Создать -…»:
[HKEY_CLASSES_ROOT.xxxShellNew]
«FileName»=»file.xxx»
Примечания:
-.xxx — расширение создаваемого файла

-file.xxx — файл, используемый в качестве шаблона при создании. Если не указан полный путь к папке в которой хранится файл шаблона, то система пытается найти этот файл в папке ..Documents and SettingsusernameШаблоны, если в этой папке он отсутствует тогда просматривается папка ..WINDOWSShellNew (по умолчанию именно в этой папке должны храниться шаблоны для всех пользователей), если и в этой папке нет искомого файла, тогда пункт меню, как правило, не задействуется или (если это предусмотрено программой) создается файл по умолчанию. Если требуется создавать файл по умолчанию, то вместо указанного выше параметра «FileName»=»file.xxx» создается пустой строковый параметр «NullFile»=»»

-имя создаваемого меню (а также файла) совпадает с описанием типа файла, который указан как параметр по умолчанию раздела
[HKEY_CLASSES_ROOTxxxfile]

Если требуется удалить пункт меню, удалите раздел
[HKEY_CLASSES_ROOT.xxxShellNew]

Создание псевдонимов к программам

Windows позволяет создавать псевдонимы для запуска программ и открытия файлов. Например вместо того чтобы набирать такой путь как C:WINDOWSHelpntcmds.chm (или hh ntcmds.chm) можно создать псевдоним кс (или любой другой) и открывать набрав это сокращение в меню «Выполнить» или из панели инструментов «Адрес». Для создания псевдонима следует внести следующие изменения в реестр — в разделе

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionApp Paths]

создайте подраздел кс.exe и присвойте параметру «По умолчанию» значение C:\WINDOWS\Help\ntcmds.chm
Теперь если набрать псевдоним кс в меню «Выполнить» или в панели инструментов «Адрес», откроется файл C:WINDOWSHelpntcmds.chm (справочник по командной строке).

Скрытие/отображение пользователей в диалоговом окне входа в систему

По умолчанию в диалоговом окне входа в систему отображаются иконки пользователей, зарегистрированных в системе. Чтобы скрыть какого-то пользователя из этого окна, создайте в разделе
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonSpecialAccountsUserList] параметр типа dword
«user»=»00000000», где «user» — имя пользователя, которого нужно удалить из окна входа в систему.
Теперь чтобы войти в систему под учетной записью такого пользователя, необходимо будет нажать Alt Ctrl и не отпуская этих клавиш дважды нажать Del, после чего ввести данные пользователя для входа в систему. Точно так же по умолчанию не отображается учетная запись «Администратор», чтобы отобразить ее в окне входа в систему, создайте в разделе
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonSpecialAccountsUserList] параметр типа dword
«Администратор»=»00000001»

Запрет отображения программ в списке часто используемых

По умолчанию в меню Пуск отображается список наиболее часто используемых программ для быстрого доступа к этим программам. Эту возможность можно отключить с помощью интерфейса Windows. Но что делать если сама возможность нас устраивает, но мы не хотим чтобы какие-то определенные программы не отображались в этом списке? Добавьте в раздел реестра (или отредактируйте существующий):
[HKEY_CLASSES_ROOT Applicationsprog.exe] пустой строковый параметр NoStartPage, где prog.exe — имя приложения.

Приложение будет удалено из существующего списка и больше не появится в нем. Запретить отображение иконок на рабочем столе — Если применить этот совет, ярлыки на рабочем столе отображаться не будут. После восстановления этой функции все созданные в скрытом режиме ярлыки будут отображены. Чтобы скрыть ярлыки, найдите раздел реестра

[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced]

и установите значение параметра «HideIcons»=»1» Запрет использования клавиши Win — Чтобы запретить использование Win, внесите следующие изменеия в реестр (привожу в виде reg файла чтобы не запутаться с вводом значений):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlKeyboard Layout]
«Scancode Map»=hex:00,00,00,00,00,00,00,00,03,00,00,00,00,00,5B,E0,00,00,5C,E0,00,00,00,00

Запрет обновления метки последнего доступа к файлам каталога — Если у вас файловая система NTFS, при открытии каталога обновляются метки последнего доступа ко всем файлам этого каталога. Чтобы отключить эту функцию(это ускорит работу системы при большом количестве файлов), необходимо в раздел

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystem]
добавить параметр типа DWORD «NtfsDisableLastAccessUpdate»=»1»

Изменение скорости открытия меню

Все меню Windows XP открываются с определенной задержкой, чтобы изменить время этой задержки, найдите раздел
[HKEY_CURRENT_USER/Control Panel/Desktop] и измениете значения ключа MenuShowDelay
По умолчанию это значение равно 400. Если установить значение равным 0, меню будут открываться значительно быстрее.

Удалить стрелочки на ярлыках можно удалив следующие параметры:
[HKEY_LOCAL_MACHINESOFTWAREClasseslnkfile] «IsShortcut»
[HKEY_LOCAL_MACHINESOFTWAREClassespiffile] «IsShortcut»

Список установленных программ можно найти здесь:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrenyVersionUninstall]
Если после деинсталляции программы она отображается в списке «Установка и удаление программ» , удалите ненужные программы из списка подразделов этого раздела.

Изменить информацию о зарегистрированном владельце копии Windows можно найдя раздел:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsNTCurrentVersion] и изменив параметры:
«RegisteredOrganization»=Owner» и «RegisteredOwner»=Owner»

Изменить серийный номер Windows можно найдя и изменив параметры следующих разделов:
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsNTCurrentVersion] «ProductId=xxxxx-xxx-xxxxxxx-xxxxx
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrenyVersion] «ProductId=xxxxx-xxx-xxxxxxx-xxxxx
[HKEY_LOCAL_MACHINESOFTWAREInternet ExplorerRegistration] «ProductId=xxxxx-xxx-xxxxxxx-xxxxx

Программы, которые стартуют автоматически при загрузке системы можно найти в следующих разделах:
[HKEY_LOCAL_MACHINESoftware MicrosoftWindowsCurrentVersionRun]
[HKEY_LOCAL_MACHINESoftware MicrosoftWindowsCurrentVersionRunOnce]
[HKEY_LOCAL_MACHINESoftware MicrosoftWindowsCurrentVersionRunOnceEx]
[HKEY_CURRENT_USERSoftware MicrosoftWindowsCurrentVersionRun]
[HKEY_CURRENT_USERSoftware MicrosoftWindowsCurrentVersionRunOnce]

Отключить автозапуск CD можно найдя раздел
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesCdrom] и установив значение параметра: «AutoRun» =»0″

Отображать версию Windows в правом нижнем углу экрана — чтобы включить эту опцию, найдите раздел
[HKEY_CURRENT_USERControl PanelDesktop] и установите значение параметра «PaintDesktopVersion» =»1″

Изменение раскладки клавиатуры при входе в систему

В диалоговом окне входа в систему, можно видеть индикатор раскладки клавиатуры, при этом раскладка по умолчанию определяется параметрами при установке Windows. Параметры, отвечающие за раскладку в диалоговом окне входа в систему, хранятся в следующих ключах реестра:

[HKEY_USERS.DEFAULTKeyboard LayoutPreload]
«1»=»xxx» (основная, по умолчанию)
«2»=»xxx» (дополнительная, переключение)
где «xxx» может принимать значения: «00000409» — английская раскладка и «00000419» — русская раскладка.

Не отображать напоминания Outlook Express

По умолчанию при использовании в качестве почтовой программы Outlook Express в диалоговом окне входа в систему под значком пользователя показывается количество непрочитанных почтовых сообщений. Чтобы удалить эти напоминания, внесите следующие изменения в реестр:
[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionUnreadMail]
«MessageExpiryDays»=dword:00000000
Параметр dword:00000000 указывает на количество дней, после которого система перестает напоминать о непрочитанных сообщениях.

Не разрывать связь при выходе из системы

По умолчанию если установлено интернет-соединение и пользователь выходит из системы, связь прерывается. Но можно изменить параметры реестра так, что установив соединение под одной учетной записью можно сменить пользователя и продолжить работу не разрывая соединения. Для этого следует внести следующие изменения в реестр: в разделе
[HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionWinlogon] создайте строковый параметр
«KeepRASConnections» и присвойте ему значение «1»


Понравилась статья? Поделить с друзьями:
  • Hkey local machine software policies microsoft windows windowsupdate
  • Hkey local machine software policies microsoft windows safer codeidentifiers
  • Hkey local machine software policies microsoft windows defender
  • Hkey local machine software microsoft windows photo viewer capabilities fileassociations
  • Hkey current user software microsoft windows shell bags 1 desktop