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: Open Command Window Here as Administrator

04 Nov 2014   #20
klepp0906

8.1
 
 

Is there any way to change out the shift+click command prompt for a shift+click elevated command prompt?

Id rather keep the shift functionality but prefer it to be elevated

Ive been digging with no such luck :P


My System SpecsSystem Spec
.
04 Nov 2014   #21
Brink

64-bit Windows 10 Pro
 
 

Hello Kevin,

The tutorial on the first page lets you just right click on a folder or drive to open an elevated command prompt at that location.

If you like, I could have it where you would have to use Shift with it.
My System SpecsSystem Spec
04 Nov 2014   #22
klepp0906

8.1
 
 

Yes, if you could provide a Reg file to make it require shift that would be excellent. As well as a means to undo it. I've been using the right click means for awhile but I'm trying to clean up my context menu a bit and the ability to use it as naturally implemented but with the prompt being an elevated one instead if standard is ideal if possible.

Thank you!
My System SpecsSystem Spec
04 Nov 2014   #23
Brink

64-bit Windows 10 Pro
 
 

You're most welcome.

I added step 3 for the shift + right click option. Step 4 will still work to remove them.
My System SpecsSystem Spec
.

30 Apr 2016   #24
greens

Windows 7 Ultimate x64
 
 
Windows Libraries

Normally Libraries has no support for "Open command window here", however it can be added using this registry entry:

Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd]
@="@shell32.dll,-8506"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\cmd\command]
@="cmd.exe /s /k pushd \"%V\""
Therefore the Administrator version can easily be added:

Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas]
"HasLUAShield"=""
@="Open command window here as Administrator"

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
My System SpecsSystem Spec
30 Apr 2016   #25
Brink

64-bit Windows 10 Pro
 
 

Thank you greens, and welcome to Seven Forums. I added this to the tutorial to help others.
My System SpecsSystem Spec
05 Feb 2017   #26
appyface

Win7 Pro SP1 64-bit
 
 

I've been looking for some time for a way to add Open Command Window Here as Administrator to the file context menu. Does anyone know a solution?

Since Vista forward it is possible to get Open Command Window Here in explorer right-side (file) pane, provided you can right-click on a completely blank line (not just a blank area), such as in the area below the list of files.

There is no such blank area if the list of files exceeds a page full though, so this is not too convenient. And no way to get an elevated CMD window AFAIK.

I did add an Open CMD window to the file's send-to options on the context menu, this is very convenient. But I don't know how to modify it to open as elevated? Maybe someone knows how?

To add Open CMD window to the file's send-to options, do the following. Works for me in all versions of Windows from NT on up.

Find the user's send-to folder for the version of windows. Create a batch file there, I call mine OpenCMDPromptHere.bat.
@echo off
%~d1
CD %~dp1
CMD /K

OpenCMDPromptHere.bat will now show up as an entry under user's send-to menu for files.

Thank you for any help getting an elevated prompt onto the file context menu directly, or in the file's send-to menu similar to the above.

Kind regards.
My System SpecsSystem Spec
05 Feb 2017   #27
Brink

64-bit Windows 10 Pro
 
 

Hello appyface,

Usually when you "open a command prompt here", it's for a location instead of file.

Opening a file in a command prompt will essential be the same as just opening the file.

If you're just wanting to open a file elevated, then the "Run as administrator" context menu will basically serve the purpose you want for application files (ex: ".exe").

Was there some specific task you were wanting to do that this doesn't apply to?
My System SpecsSystem Spec
05 Feb 2017   #28
appyface

Win7 Pro SP1 64-bit
 
 

Hello Brink,

Thank you for your reply.

I'm very sorry I wasn't clear. I wish to open CMD as Administrator for the directory location where the file is, but from the file's context menu.

I have achieved this for normal CMD window with the send-to menu method I gave. But I don't know how to modify that method to also provide an elevated CMD window from file's send-to menu.

And I haven't found any other way to add CMD window (or CMD as Administrator window) to the file's context menu so far.

For me it's a fair pain to traverse the left pane directory tree for the subdirectory (which I don't usually have expanded) just so I can get to the context menu.

It's less of pain to navigate up a level from the file pane and get to the subdirectory context menu that way, but if there are many subdirectories it's still not the friendliest method.

If there is a fully-blank area below the file list the normal CMD window can be gotten with shift-right-click in native Windows (since Vista), but not the CMD as Administrator window AFAIK. And there is no blank area below when the file list exceeds one page, that I can find.

It is just so very convenient to have CMD window available from the file's context menu. That is why I wish to add the elevated option there, if it is possible?

Kind regards.
My System SpecsSystem Spec
05 Feb 2017   #29
Brink

64-bit Windows 10 Pro
 
 

I'm not sure how to do so from the file's context menu as well.

You should be able to Shift+right click on the background of the window the file is located to see Open Command Window Here as Administrator.

If you don't, then see if you do after using the download from step 2 or 3.
My System SpecsSystem Spec
Reply

 Open Command Window Here as Administrator




Thread Tools




Similar help and support threads
Thread Forum
Open Command Window Here - Add or Remove
How to Add or Remove "Open Command Window Here" from Context Menu in Windows This will show you how to add or remove Open Command Window Here from the context menu of the desktop, folders, and drives in Vista, Windows 7, and Windows 8. You must be logged in as an administrator to be able to...
Tutorials
Open Command Window Here
How to Use "Open Command Window Here" in Windows 7 This will show you how to use the Open Command Window Here context menu item of a folder or drive to open a command prompt with the focus at the folder or drive location in Windows 7. This will make it easier to perform a command task at...
Tutorials
Open Network window with a command?
Hi there, i would like to know if its possible to open up this window with a command in the commandprompt? I was planning on putting it in a batch file and execute the batchfile with a button made in rainmeter. Would be very handy for people who have a customized taskbar. At the moment I've only...
Customization
Open Command Window Here
For all DRIVES, <shift>|right-clicking displays OPEN COMMAND WINDOW HERE in the context menu, above the first separator. That item opens the command prompt. But for all other folders the OPEN COMMAND WINDOW HERE item displays below the first separator in the context box, and clicking on it...
General Discussion
Problem open command Window(administrator)
I'm trying to create some auto setup procedures but can not setup a CMD administrator command ( non administrator seems to work) registry tweak ; //run administrator command from explorer @="Open Command Window Here (Administrator)"
Network & Sharing
Open elevated command window here
I could prolly figure it out but does anyone know offhand how to add an "Open elevated command window here" option in addition to the "Open command window here" shift+context menu for a folder?
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 12:29.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App