1. #1
    Unregistered

    Procedure to add "Run as" menu for .CMD and .BAT file extensions?

    Can anyone explain me the procedure to add “run as” menu for .cmd and .bat file extensions? I am using windows 7 ultimate.



  2. #2
    deepak552 Array
    Join Date
    Jun 2012
    Location
    Hyderabad
    Posts
    105

    Re: Procedure to add "Run as" menu for .CMD and .BAT file extensions?

    To add the Run as... option for .BAT files to the context menu, use the following REG file:


    Windows Registry Editor Version 5.00


    [HKEY_CLASSES_ROOT\batfile\shell\runas\command]
    @="\"%1\" %*"
    Copy the above contents to Notepad, and save the file with .REG extension (say, bat_runas.reg). Right-click the .REG file and choose Merge.


    To add the Run as... menu for .CMD files, use this REG file:


    Windows Registry Editor Version 5.00


    [HKEY_CLASSES_ROOT\cmdfile\shell\runas\command]
    @="\"%1\" %*"
    Copy the above contents to Notepad, and save the file with .REG extension (say, cmd_runas.reg). Right-click the .REG file and choose Merge.

    gu.jpg


  3. #3
    supermaster Array
    Join Date
    Jun 2012
    Posts
    349

    Re: Procedure to add "Run as" menu for .CMD and .BAT file extensions?

    My dear friend,
    If you have made your own batch files to execute multiple instructions at one time and want to run as administrator,thats what i'm supposing from your question.
    It is simple select the file and right click and hold the shift button.
    you will get the option run as administrator.

    All the best.

  4. #4
    edge Array
    Join Date
    Oct 2012
    Posts
    17

    Re: Procedure to add "Run as" menu for .CMD and .BAT file extensions?

    Quote Originally Posted by Unregistered View Post
    Can anyone explain me the procedure to add “run as” menu for .cmd and .bat file extensions? I am using windows 7 ultimate.
    To add the Run as... menu for .CMD files, use this REG file:


    Windows Registry Editor Version 5.00


    [HKEY_CLASSES_ROOT\cmdfile\shell\runas\command]
    @="\"%1\" %*"


    To add the Run as... menu for .BAT files, use the following REG file:


    Windows Registry Editor Version 5.00


    [HKEY_CLASSES_ROOT\batfile\shell\runas\command]
    @="\"%1\" %*"


    Copy the above contents to Notepad, and save the file with .REG extension (say, cmd_runas.reg). Right-click the .REG file and choose Merge.

  5. #5
    Dreamer Array
    Join Date
    Jul 2013
    Posts
    116

    Re: Procedure to add "Run as" menu for .CMD and .BAT file extensions?

    Hi Friend,

    Follow this steps to add run as menu.

    Open notpad and paste this code in it for bat file.
    [HKEY_CLASSES_ROOT\batfile\shell\runas\command]
    @="\"%1\" %*"
    and save the file with .REG extension.
    THen Right-click the .REG file and choose Merge.

    Again Open notpad and paste this code in it for cmd file.
    [HKEY_CLASSES_ROOT\cmdfile\shell\runas\command]
    @="\"%1\" %*"
    and save the file with .REG extension.
    Then Right-click the .REG file and choose Merge.

    Restart Pc
    and check for runas menu from cmd.

    I hope you will understood.

    All the Best.

  6. #6
    heemanshubhalla Array
    Join Date
    Sep 2012
    Location
    India
    Posts
    570

    Re: Procedure to add "Run as" menu for .CMD and .BAT file extensions?

    For normal .Exe files you can get Run as Menu by pressing Shift + Rightclick. But this method does not work
    for .bat and .cmd files. So you have add that option by creating Registry file

    1. Right click on Desktop
    2. click on New
    3. Then select Notepad

    4. Now copy the code written below to this notepad file


    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\cmdfile\shell\runas\command]
    @="\"%1\" %*"


    5. Now press "Ctrl + s" to save this file
    6. save it with "Runas.reg" on desktop or other place you want
    7. Now right click on "Runas.reg" file
    8. click on "Merge"

+ Reply to Thread

Similar Threads

  1. Replies: 24
    Last Post: 13-08-2013, 04:30 PM
  2. Replies: 3
    Last Post: 06-05-2013, 05:39 PM
  3. Replies: 2
    Last Post: 14-09-2012, 11:07 PM
  4. Replies: 2
    Last Post: 14-09-2012, 10:45 AM
  5. Replies: 10
    Last Post: 15-08-2012, 10:09 PM