![]() |
|
31 Dec 2009 | #1 |
|
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 Code:
; //run administrator command from explorer [HKEY_CLASSES_ROOT\Directory\shell\runas] @="Open Command Window Here (Administrator)" [HKEY_CLASSES_ROOT\Directory\shell\runas\command] @="cmd.exe /s /k pushd \"%V\"" but as I'm using a networked device (win7/64 fresh install -stable) the command prompt never apears (immedialty stops) both on mapped device net user //server/share x: /persist:yes and direct //server/share (workgroup//homegroup) any tips to further debug the problem /maybe a solution ??? |
My System Specs![]() |
. |
|
31 Dec 2009 | #2 |
|
Hi dreuzel,
This reg entry appears to create a right click option called "Open Command Window Here (Administrator)", which in turn opens a CMD prompt with admin elevation. You are saying that mapped drives don't open but local drives do, this is correct so far yeah? Take a look for any other entries in the registry that might effect the results. The places to check are: Computer\HKEY_Classes_root\*\shell\runas Computer\HKEY_Classes_root\Directory\shell\runas Meanwhile I'll test this too and let you know what I find. |
My System Specs![]() |
31 Dec 2009 | #3 |
|
Well I did some testing and found that I would receive the error "The system cannot find the drive specified." when I used the "Open Command Window Here (Administrator)" right click option on a networked mapped-drive shorcut.
However there is a workaround - Don't use the mapped drive shortcut, use a UNC shortcut. e.g. \\networkedPC\myshare mapped as Z:\myshare If you right click on the shortcut Z:\myshare it fails with "The system cannot find the drive specified" error opening in your CMD window. If you rightclick on the shortcut \\networkedPC\myshare a temporary drive letter is allocated and it works. Hope this helps. |
My System Specs![]() |
. |
|
04 Jan 2010 | #4 |
|
exactly my point
Now using Dos commands I often get problems they can not handle the UNC this is long term project of MS to get that in order ....... spec's so we are in a locked up situation require UNC to work all over ..... is there a way to add a mapped device ... (adding something before the mapped command @="cmd.exe /s /k pushd \"%V\"" are there alternatives as %cd% what is %v in this case is this explained somewhere |
My System Specs![]() |
04 Jan 2010 | #5 |
|
I'm not understanding a key piece of the puzzle here. 1. What are you creating auto setup procedures for (is it software, installation, policy roll outs, etc)? I'm just trying to understand why the right click to admin-cmd is needed? If there is a different way to get the same results, understanding the project will help me help you. 2. Is this to go into a batch or vbs script? 3. The workaround is not good because UNC paths fail for another part of your project is this correct? you can normally link to CMD lines together with the && command; but I tried for a few minutes and failed with our mapped drives. I also looked at finding the current path with %~dp0 Code:
set curpath=%~dp0 pushd %curpath% Yep there's plenty of alternatives depending on what you want to do. For example if I was to..... Code:
net use X: \\media\PICTURES X: You could use ~dp0 in place of %cd% for some instances. for an example paste these into a bat or a command window Code:
echo this is %%cd%% %cd% echo this is %%~dp0 %~dp0 |
My System Specs![]() |
06 Jan 2010 | #6 |
|
A follow-up.
It doesn't work for me outside of the workaround I provided earlier. Hmm strange stuff. Let me know the answers to my questions above and we'll think of a route forward. |
My System Specs![]() |
11 Jul 2010 | #7 |
|
fix
i've been looking for how to do this in win7 for a while. it was SO much more simple in XP. your solution was close and got me started. :)
here is a fix that worked for me: [HKEY_CLASSES_ROOT\Directory\shell\runas\command] @="cmd.exe /k \"pushd %L && title Command Prompt\"" |
My System Specs![]() |
. |
11 Jul 2010 | #8 |
|
i've been looking for how to do this in win7 for a while. it was SO much more simple in XP. your solution was close and got me started. :)
here is a fix that worked for me: [HKEY_CLASSES_ROOT\Directory\shell\runas\command] @="cmd.exe /k \"pushd %L && title Command Prompt\"" |
My System Specs![]() |
![]() |
Thread Tools | |
Similar help and support threads | ||||
Thread | Forum | |||
Open Command Window Here as Administrator Add or Remove "Open Command Window Here as Administrator" to Context Menu This will show you how to add or remove Open Command Window Here as Administrator to the context menu of a folder, drive, and desktop of all users to open an elevated command prompt with the focus at the library, folder,... |
Tutorials | |||
Open command window here not working Open command window here not working Left click a blank space in the folder to ensure you haven't selected anything and hold CTRL + Shift and Right click in a blank space. i want to Merge text(.text)files and for that i need to Open command window in a folder dierectory, any solution? thanks... |
General Discussion | |||
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 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 | |||
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 21:13. |
![]() ![]() |