It seems that you are new here. You may want to sign up for e-mail updates or subscribe to my RSS feeds. Thanks for visiting!
In Windows, you have the option of running certain applications and certain commands by typing them in the Run dialog box but there is no option for users to add their own command. This tutorial teaches how you can make the Run dialog box to accept your commands and do what you want. This tutorial is for Windows XP. It should work for other windows also but I haven’t tested it.
More explanation of what Run do:
Hit Win + R and Run dialog box opens up (Alternatively you can select Start > Run) . Type in command and press enter. For example :
osk -> On-screen Keyboard
cmd -> Command Prompt
wmplayer -> Windows Media Player
sol -> Solitaire
Now if you type some other command that is unrecognized, it gives an error (The most obvious thing to tell)
How to make Run dialog box accepts your command?
You can call any file places in your C:\WINDOWS\system32 by directly typing the name of the executable file and with extension if it is not a executable file. We have two options with us now. Either we create batch files and place them in system32 folder and call them as name.bat (with extension) or we create executable files and place them in system32 folder and then call them by name (no need of specifying extension if it is a *.exe).
What it can do?
The limiting factor is you and the DOS itself i.e. What we want to do and can it be done through DOS. Not every program supports command line version (it can’t be executed in the command prompt).
How to create batch files?
Open notepad and type in the commands.

From the File menu select Save as and there save it as name.bat and make sure Save as type is selected as All Files.
Example - Remove USB/Thumb/Pen drive
Make a batch file with the content
RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll
save it as rpd.bat or whatever you want (whatever you can’t forget)
Place this batch file under C:\WINDOWS\system32\ and you can call this batch file by typing the name in Run dialog box.

For more examples, more help on batch files and link to online *.bat to *.exe convertor, following post is recommended: Creating Batch Files
Tags: add commands on run · create custom commands for run · run as command · windows run command11 Comments




11 responses so far ↓
Nice article dude, what about such things in linux and ubuntu os.
@Abhishek
Thanks buddy.
Sorry I don’t use Linux for now. So no idea about that. May be in the coming weeks I can lay my hands on Ubuntu.
The other way is add application path to:
Control Panel - Properties - Advanced - Environment Variables - System Variables - Path.
[...] How to create custom commands for Run dialog box in windows [...]
Nice tip, thanks for sharing
@Gadget
You are most welcome my friend.
explain more bout pen drive running custom command
where to write Remove USB/ Thumb/Pen……?
I just searched something like that. Thanks!
In linux /usr/bin is the main one, there are others but I wouldn’t go there.
@Ankit
I got you very clear in offline world. Didn’t I?
@James
I am not a linux user so don’t have any idea about that and I don’t understand what you meant to say.
HI
when I click on cmd - the run dialog box does not come up - it ask me with what program I want to open it pls help.