Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Add elevated command prompt to context menu

27 Jun 2011   #1
montecarlo1987

Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
 
 
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 System SpecsSystem Spec
.

27 Jun 2011   #2
montecarlo1987

Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
 
 

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 System SpecsSystem Spec
27 Jun 2011   #3
Brink
Microsoft MVP

64-bit Windows 10 Pro
 
 

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 System SpecsSystem Spec
.


28 Jun 2011   #4
montecarlo1987

Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
 
 

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 System SpecsSystem Spec
28 Jun 2011   #5
montecarlo1987

Windows 7 Pro x64 SP1 & Windows 8 & 8.1 Pro x64
 
 

@ Brink
Brink, your link to the instructional thread (http://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 System SpecsSystem Spec
28 Jun 2011   #6
Brink
Microsoft MVP

64-bit Windows 10 Pro
 
 

You're most welcome Montecarlo. I'm glad that we could help.
My System SpecsSystem Spec
Reply

 Add elevated command prompt to context menu




Thread Tools





Similar help and support threads
Thread Forum
Elevated Command Prompt Shortcut
How to Create an "Elevated Command Prompt" Shortcut in Windows 7 and Windows 8 This tutorial will show you how to create a shortcut that will open an elevated command prompt with administrator rights in Windows 7 and Windows 8. When you use the elevated command prompt shortcut, you may be...
Tutorials
Elevated Command Prompt
How to Open an Elevated Command Prompt in Windows 7 This will show you how to open an elevated command prompt with administrator rights (Run as administrator) instead of the default command prompt without administrator rights in Windows 7. If you opened the elevated command prompt from a...
Tutorials
Elevated command prompt over SSH
Not sure if this is the proper forum for my question, but here it goes. I'm using a SSH server to remotely access my notebook from work. It works well for SFTP and remote command line access using a dedicated, non-admin, user account. Problem is when I want to run something that requires...
Network & Sharing
Tip for Elevated Command Prompt
This probably is not new to many, but I find it useful. There are times I want an elevated command prompt. I usually type in "cmd", right click on it and run as administrator. If you need an elevated command prompt now and then, simply create a shortcut to "cmd". Right click on the shortcut,...
General Discussion
How to open Elevated Command Prompt?
Hi friends ! Uber Philf told me to start a new thread with my problem. I cannot open an Elevated Command Prompt, Dont know why. I know that I can open it in two alternative ways : 1). Win+R, type cmd, hit enter eith ctrl+shift pressed ; and 2). start > all programs > accessories > command prompt >...
Performance & Maintenance
elevated command prompt fails
If i try and use cmd from within the start menu ,in accessories and right click ,then "Run as administrator",all i am granted is normal cmd usage e.g(C:\Users\(User Name ).Now,i then pinned cmd to the start menu and again i tried to "run as administrator",but this time cmd fails to open at all. ...
General Discussion

Our Sites

Site Links

About Us

Find 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 06:53.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App