Page 1 of 1

Command prompt with admin rights

Posted: 2012-11-14, 23:45 UTC
by garisan
Hi
I very often use the Open Command Prompt from the Command menu and like it from there because I can open it right in the folder I am. However it would be interesting to add the option to open it with admin privileges, may be with a modifyer key (ie. open it while holding shift key).
To do that now I have to open another copy of TC with admin rights but is not very comfortable to do it that way.

Thanks,
Gabriel

Posted: 2012-11-15, 10:28 UTC
by Stefan2
You can create your own command in an button
or e.g. here for usercmd.ini

Code: Select all

[em_evaadm]
cmd=*%comspec% /k
The trick is to use the leading star '*' to elevate the command prompt.


To add this to your menu,
- open the language file (e.g. WCMD_ENG.MNU) (i recommend "Extended English Menus (by petermad)")

- search for

Code: Select all

  MENUITEM "Open comman&d prompt window", cm_ExecuteDOS
or

Code: Select all

  MENUITEM "Open Comman&d Prompt Window...", 511
and add a line:

Code: Select all

  MENUITEM "Open comman&d prompt window (elevated)", em_evaadm
Note that "em_evaadm" recommits to the usercmd.ini.


To make this task complete we can add more of this stuff:

Code: Select all

[em_evaadm_W764_64bitCMD]
cmd=*c:\Windows\System32\cmd.exe
[em_evaadm_W764_32bitCMD]
cmd=*c:\Windows\SysWOW64\cmd.exe

  MENUITEM "Open comman&d prompt window... (elevated 32-bit)", em_evaadm_W764_32bitCMD
  MENUITEM "Open comman&d prompt window... (elevated 64-bit)", em_evaadm_W764_64bitCMD
Note: works only as indented with 64-bit TC on 64-bit Win7

Posted: 2012-11-15, 11:50 UTC
by garisan
Thank you, that did the trick ! Also followed your recommendation and downloaded the extended menus and are really astounding.

Thanks,
Gabriel