Add elevated command prompt to context menu


  1. Posts : 145
    Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
       #1

    Add elevated command prompt to context menu


    @ AceInfinity & anyone who wishes to respond:

    Hello. Nice to meet you. I have a question to ask you or anyone that would like to help me...

    After seeing your example above, it got me thinking... ...I would like to add to my context menu an elevated command prompt (with administrator privileges) in the same or similar coding fashion (not binary code) as in this example below. The key is that it has to be "elevated" with Administrator privileges, not just a normal command prompt to open. I am not sure how to write a working script since it "MAY" (probably is) quite different than the coding pattern in my example here after including the 'elevated' coding component part to it:

    [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated Command Prompt]

    [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated Command Prompt\command]
    @="control appwiz.cpl"

    Please correct by adding and or deleting or modifying the script above so the code that would demonstrate a working "elevated" command prompt script to open in a window.

    I would also like to add the command prompt icon to my context menu too. I am very sure that it would look something like this (pretty sure if the registry key information is correct though, probably it is not since I am looking for the script to be 'elevated' as I have already stated):

    [HKEY_CLASSES_ROOT\Directory\Background\shell\Elevated Command Prompt]
    "Icon"="C:\\Windows\\Context Menu Icons\\Elevated Command Prompt.ico"

    Where an "Elevated Command Prompt" ico icon in a "Context Menu Icons" folder would be FIRST placed in the C:\Windows folder location BEFORE running a workable elevated command prompt registry script.

    So what is the proper coding I need to do (and appropriately placed in this script) in order to add an elevated command prompt with the icon to this script so it works in the context menu???

    Please... ...if you would write one for me from the example above, I will get the idea on what I need to do. It cannot be too long of a script to modify in some way.

    Please reply.

    Thank you!

    NOTE: Script written for Windows 7.
      My Computer


  2. Posts : 145
    Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
    Thread Starter
       #2

    Hello. I tested with the test registry script and yes... ...I have the name "Elevated Command Prompt" in my context menu with the representative icon, and CMD does open successfully... ...the only issue is that it is NOT "elevated", but a "regular" command prompt. That is the question... ...what do I need to modify (subtract or add) to the code in order to the "elevated" command prompt (administrator privileges)??? Please provide the script to accommodate these changes.

    Please reply.

    Thank you!
      My Computer


  3. Posts : 72,050
    64-bit Windows 11 Pro for Workstations
       #3

    Hello Montecarlo,

    You might also see if this may work you as well. It will add Open Command Window Here as Administrator to the file, folder, and Desktop context menu.

    Open Command Window Here as Administrator

    Hope this helps,
    Shawn
      My Computer


  4. Posts : 145
    Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
    Thread Starter
       #4

    Hello again. May I be a pain in your rear and ask you how the entire script would be assembled? I absolutely apologise for nagging you! I tried adding it and a few diferent ways as well to the script you have above and I still get the "regular" command prompt. Could you please add the entire corrected script as a reg file in your reply to make matter easy!

    Please reply!

    THANK YOU EVER SO MUCH!!!
      My Computer


  5. Posts : 145
    Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
    Thread Starter
       #5

    @ Brink
    Brink, your link to the instructional thread (https://www.sevenforums.com/tutorials/47415-open-command-window-here-administrator.html) works like a top!!! I love it!!! It gives me not only features
    to the drive or folder, but also the desktop -- what exactly I am looking for!!!
    I would of never figured out that code... ...I am kind of new to script coding and I would of definitely needed help there!

    AGAIN, THANK YOU SO MUCH!!!!! YOUR A BLESSING!!!!


    I personally thank you for your instructions, the added additional points you have posted (THEY ARE USEFUL!) and sticking by me as I was pestering you!!! Your definitely a friend of mine to help me and others here as well!!! You are an asset to this forum as well!!!

    Again, thank you!!!
      My Computer


  6. Posts : 72,050
    64-bit Windows 11 Pro for Workstations
       #6

    You're most welcome Montecarlo. I'm glad that we could help. :)
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:24.
Find Us