How to Open Any Program by Typing its Name in RUN Dialog Box in Windows?
NOTE: We have released a free utility to do the whole task automatically: Run Editor.
One of our readers “Balaji” asked us following question:
Hi Vishal,
Advertisement
I want to know how to create a registry entry for application shortcuts?
example:
For opening a notepad we go to start – run and type notepad
For opening paint brush we use start – run and type mspaint
Similarly i want to set keywords for opening specific applications in my desktops.
For that what is the registry keyword i need to create / modify… Pls guide me
looking forward for your reply.
Thanks in advance
Yes. That can be done easily using Windows Registry. You can open any desired 3rd party program by just typing its name in RUN or Start menu Search box and press Enter.
You’ll need to set the application path in Windows Registry so that Windows can know about the application at the time of execution.
PS: Before starting the tutorial lets assume that our desired application name is “My Application“. Its an EXE file and is stored in “C:\Program Files\My Application\” folder. It’ll help you in easily understand the tutorial.
So without wasting any time, lets start our tutorial:
Advertisement
1. Type regedit in RUN or Start Menu search box and press Enter. It’ll open Registry Editor.
2. Now go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
3. Now we’ll need to create a new key under “App Paths” key. Right-click on “App Paths” key and select “New -> Key“. Set its name to your desired application name along with its extension e.g. My_Application.exe
4. Select the key created in Step 3 and in right-side pane, set value of “Default” to the full path of application’s EXE file e.g. C:\Program Files\My Application\My Application.exe
5. Again in right-side pane, create a new String value “Path” and set its value to the folder containing your application EXE file e.g. C:\Program Files\My Application\
6. That’s it. Now you can launch your desired application by just typing its name in RUN or Start menu Search box.
NOTE: If you want a ready-made registry script to do the task automatically, then copy paste following code in Notepad and save the file with name “AskVG.REG” (including quotes).
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\My Application]
@="C:\\Program Files\\My Application\\My Application.exe"
"Path"="C:\\Program Files\\My Application\\"
You just need to replace BOLD part of the above script with the correct application name and path. After saving the file, run it and it’ll add the program path to Registry so that you can launch it directly from RUN and Start menu Search box.
This is really a time saver. Nice to see this sort of hacks again.
VG
someone has created a new software using your tutorial. i am sure you already know about him. 😉
pliz send mi some of the excecutable name to enter in the run dialog box in order to open simple programs easily
I can’t believe this step is not made during installation.
i think with this (the .exe) it will work better:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\My Application.exe]
and btw the 2nd line seems useless
so this is a revised .reg
***********************************************************************************
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe]
@=”C:\\Program Files\\MyApp\\MyApp.exe”
“Path”=”C:\\Program Files\\MyApp\\”
***********************************************************************************
Plus i modified a script to automate the change
it will ask for the app to add, and for its path
if left blank, C:\Program Files\ is default loation
otherwise the argument becomes the path (usefull for portable applications left in a repo folder not in C:\Program Files\)
***************************
***************************
***************************
Dim RegAppPath
Dim RegLastKey
Dim ProgtoAdd
Dim CustomPath
Set WshShell = CreateObject(“WScript.Shell”)
‘add any program to registry app path
‘so that apps can be launched from RUN
‘apps from default c:\program files location dont require the path to be filled
‘portable apps or apps from other location require the path without last “\”
‘based on (with some syntax changes: escape” is not \” but “”)
‘ [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MyApp.exe]
‘ @ = “\”C:\\Program Files\\MyApp\\MyApp.exe\””
‘ “Path” = “\”C:\\Program Files\\MyApp\\\””
‘the key to amend
RegAppPath = “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\”
‘regedit opens the registry at this last place
RegLastKey = “HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey”
‘the app name how it will appear in regedit, (though Run is not case sensitive)
ProgtoAdd = Inputbox(“Which prog would you like to add to Run? without .exe”)
‘enter a path iif the app is not in C:\Program Files\
CustomPath = Inputbox(“Its path ? (left empty for default path) without last \”)
‘default path test
if len(CustomPath) = 0 then CustomPath = “C:\Program Files\” + ProgtoAdd
‘add the first key
WshShell.RegWrite RegAppPath + ProgtoAdd + “.exe\”, chr(34) + CustomPath + “\” + ProgtoAdd + “.exe” + chr(34), “REG_SZ”
‘add the second key
WshShell.RegWrite RegAppPath + ProgtoAdd + “.exe\Path”, “””” + CustomPath + “\”””, “REG_SZ”
‘add a key to open regedit where keys were added
WshShell.RegWrite RegLastKey, “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\” + ProgtoAdd + “.exe”, “REG_SZ”
‘run regedit
WshShell.Run “regedit”, 1,True
Set WshShell = Nothing
***************************
***************************
***************************
thank you very very much vishal.
i searched the whole internet for this and found on your website.
u r really a true genius.
is possible to add chkdsk to context menú drive…? how…??
regards
^^ Of course. You can add any program to context menu:
https://www.askvg.com/ultimate-tutorial-to-customize-desktop-context-menu-in-windows-vista-server-2008-and-windows-7/
Also check:
https://www.askvg.com/how-to-add-defragment-option-in-drive-context-menu-in-windows-xp-vista-and-7/
have driver in my network drive need to install from run dialog box
I know this is old but wtv. I wish that you could a custom string to be recognized to run the program. F.e: task manager is taskmgr, comand prompt is cmd, etc.