Ashfame | Tech Blog |+| Ashfame.com

I blog about blogging, tips and tricks, tutorials, hacking, hardware and reviews.

A niche is less than what I blog about.

Ashfame | Tech Blog header image

How to create custom commands for Run dialog box in windows

March 25th, 2008 by Ashfame

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.

save_batch_file

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.

run_window

For more examples, more help on batch files and link to online *.bat to *.exe convertor, following post is recommended: Creating Batch Files

StumbleDiggRedditDelicious

Tags:   · · · 11 Comments

Leave A Comment

11 responses so far ↓

  • 1 Abhishek Kumar Mar 27, 2008 at 12:57 am

    Nice article dude, what about such things in linux and ubuntu os.

  • 2 Ashfame Mar 27, 2008 at 7:12 pm

    @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.

  • 3 Ebook Mar 29, 2008 at 10:25 pm

    The other way is add application path to:

    Control Panel - Properties - Advanced - Environment Variables - System Variables - Path.

  • 4 Blog Statistics For March 2008 Apr 2, 2008 at 8:06 pm

    [...] How to create custom commands for Run dialog box in windows [...]

  • 5 Gadget Apr 3, 2008 at 7:41 pm

    Nice tip, thanks for sharing :-)

  • 6 Ashfame Apr 4, 2008 at 3:36 pm

    @Gadget
    You are most welcome my friend. :smile:

  • 7 Ankit Apr 5, 2008 at 4:16 pm

    explain more bout pen drive running custom command
    where to write Remove USB/ Thumb/Pen……?

  • 8 Apr 11, 2008 at 10:28 pm

    I just searched something like that. Thanks!

  • 9 James Apr 21, 2008 at 11:18 pm

    In linux /usr/bin is the main one, there are others but I wouldn’t go there.

  • 10 Ashfame Apr 22, 2008 at 9:02 pm

    @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.

  • 11 dalene May 9, 2008 at 12:37 pm

    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.