How to create custom commands for Run dialog box in windows

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


Comments

18 responses to “How to create custom commands for Run dialog box in windows”

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

  2. @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. The other way is add application path to:

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

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

  5. Nice tip, thanks for sharing 🙂

  6. @Gadget
    You are most welcome my friend. 🙂

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

  8. I just searched something like that. Thanks!

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

  10. @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 Avatar
    dalene

    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.

  12. hey i have a batch file i am trying to create and im trying to hook up the batch file into the http://www.runescape.com data base so i can use coomands from the batch file and hack into the game the code is:

    @echo off
    color a
    title Jimmy’s Elite Hacking System.
    break=off
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system.
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system..
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system…
    ping localhost n-2>nul
    cls
    echo loading Jimmy’s Elite hacking system….
    ping localhost n-2>nul
    cls
    set/p inputs=Are you sure you want to use my Hack system regardless of the causes? Press the ENTER key to continue…
    set/p inputs=Yes or No?
    cls
    echo loading please wait
    ping localhost n-4>nul
    cls
    echo loading please wait.
    ping localhost n-4>nul
    cls
    echo loading please wait..
    ping localhost n-4>nul
    cls
    echo loading please wait…
    ping localhost n-4>nul
    cls
    echo loading please wait….
    ping localhost n-4>nul
    cls
    echo loading please wait
    ping localhost n-4>nul
    cls
    echo loading please wait.
    ping localhost n-4>nul
    cls
    echo loading please wait..
    ping localhost n-4>nul
    cls
    echo loading please wait…
    ping localhost n-4>nul
    cls
    echo loading please wait….
    ping localhost n-4>nul
    cls
    echo loading please wait
    ping localhost n-4>nul
    cls
    echo loading please wait..
    ping localhost n-4>nul
    cls
    echo loading please wait…
    ping localhost n-4>nul
    cls
    echo loading please wait….
    ping localhost n-4>nul
    cls
    set/p inputs=Whos account would you like to hack?
    cls
    set/p inputs=Please re-type the Account name you wish to hack
    cls
    echo loading
    ping localhost n-4>nul
    cls
    echo loading.
    ping localhost n-4>nul
    cls
    echo loading..
    ping localhost n-4>nul
    cls
    echo loading…
    ping localhost n-4>nul
    cls
    echo loading….
    ping localhost n-4>nul
    cls
    echo loading
    ping localhost n-4>nul
    cls
    echo loading.
    ping localhost n-4>nul
    cls
    echo loading..
    ping localhost n-4>nul
    cls
    echo loading…
    ping localhost n-4>nul
    cls
    echo loading….
    ping localhost n-4>nul
    cls
    echo loading
    ping localhost n-4>nul
    cls
    echo loading.
    ping localhost n-4>nul
    cls
    echo loading..
    ping localhost n-4>nul
    cls
    echo loading…
    ping localhost n-4>nul
    cls
    echo loading….
    ping localhost n-4>nul
    cls
    set/p inputs=Are you sure you want to hack this Runescape account? Press the enter key to continue…
    cls
    set/p inputs=Yes or No?
    cls
    echo loading
    ping localhost n-4>nul
    cls
    echo loading.
    ping localhost n-4>nul
    cls
    echo loading..
    ping localhost n-4>nul
    cls
    echo loading…
    ping localhost n-4>nul
    cls
    echo loading….
    ping localhost n-4>nul
    cls
    set/p inputs=Hack confirmd please wait a couple seconds to see if that user is logged in.
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait.
    ping localhost n-4>nul
    cls
    echo now scanning please wait..
    ping localhost n-4>nul
    cls
    echo now scanning please wait…
    ping localhost n-4>nul
    cls
    echo now scanning please wait….
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait.
    ping localhost n-4>nul
    cls
    echo now scanning please wait..
    ping localhost n-4>nul
    cls
    echo now scanning please wait…
    ping localhost n-4>nul
    cls
    echo now scanning please wait….
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait.
    ping localhost n-4>nul
    cls
    echo now scanning please wait..
    ping localhost n-4>nul
    cls
    echo now scanning please wait…
    ping localhost n-4>nul
    cls
    echo now scanning please wait….
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    echo now scanning please wait.
    ping localhost n-4>nul
    cls
    echo now scanning please wait..
    ping localhost n-4>nul
    cls
    echo now scanning please wait…
    ping localhost n-4>nul
    cls
    echo now scanning please wait….
    ping localhost n-4>nul
    cls
    echo now scanning please wait
    ping localhost n-4>nul
    cls
    set/p inputs=Please type in a new password for the user you just hacked. Please note that the password must be 4-16 characters long.
    cls
    set/p inputs=Please re-type your password.
    SET *=account name:%runescape.com%
    cls
    set/p inputs=Before you confirm Are you sure you want to hack this account and save all changes? Press the enter key to continue…
    set/p inputs=Yes or No?
    set/p inputs=Hack confrimd the new password you requested has now been changed!
    cls
    set/p inputs=Thank-you for using “Jimmy’s Elite Hacking System”
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving.
    ping localhost n-2>nul
    cls
    echo saving..
    ping localhost n-2>nul
    cls
    echo saving…
    ping localhost n-2>nul
    cls
    echo saving….
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    echo saving
    ping localhost n-2>nul
    cls
    set/p inputs=Changes saved!
    cls
    EXIT

    just copy and paste this and copy it on to your guys note-pad

  13. @Dalene
    Hi!
    You can start “Run” and then type in CMD or alternatively you can go to Start > Programs > Accessories > Command Prompt.

    @Jack
    I didn’t get your point.

  14. Hello Everyone,
    I want to achieve RUN DIALOG BOX functinality in excel sheet.
    i.e. the way we locate our file in RUN DIALOG box , in excel sheet in a particular cell if i write D:\ then a list box should appear showing all files and directories in D drive.

    Please give your valuable suggestion on how to implement such in excel sheet and thanks in advance.

  15. Sounds good.
    Let me know how to setup a shutdown / turnoff bat file.

  16. tnx buddy,
    thats cute,
    but explain how to run an application without using notepad and creating batch files.

    1. cute? ahem..
      To run an application without using notepad and creating batch files, then just enter the direct path of the application executable in Run (Win + R).

  17. […] You can also make a custom command which you can type in Run (Win + R) to execute the batch file. Read Creating Custom Run Commands. […]