Open command window here as administrator - Add in Windows 10  

Page 6 of 11 FirstFirst ... 45678 ... LastLast

  1. Posts : 3
    Windows 10
       #50

    Brink said:
    Hello AnalyzeThis, and welcome to Ten Forums.

    I haven't worked out how to get it to work properly for a mapped network location yet.
    Thanks Brink.
    You'd think it would treat it like any other drive since it has a drive letter. I'll keep playing with it. If you figure it out - please let me know. Thanks again!
      My Computer

  2. Brink's Avatar
    Posts : 56,311
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #51

    AnalyzeThis said:
    Thanks Brink.
    You'd think it would treat it like any other drive since it has a drive letter. I'll keep playing with it. If you figure it out - please let me know. Thanks again!
    Will do.
      My Computers


  3. Posts : 3
    Windows 10
       #52

    Brink said:
    Will do.

    I was able to get the latest reg files to work by making a change to my registry.
    I created a new DWORD32 value of 0x1 named: EnableLinkedConnections in key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

    After I added it - I had to reboot for the change to take affect.
      My Computer

  4. Brink's Avatar
    Posts : 56,311
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #53

    AnalyzeThis said:
    I was able to get the latest reg files to work by making a change to my registry.
    I created a new DWORD32 value of 0x1 named: EnableLinkedConnections in key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

    After I added it - I had to reboot for the change to take affect.
    Great find.

    https://support.microsoft.com/en-us/...when-uac-is-co

    Tutorial now updated to include this.

    EDIT: New tutorial:

    Enable Mapped Drives to be Available in Elevated Command Prompt
    Last edited by Brink; 29 Apr 2020 at 15:21.
      My Computers


  5. Posts : 3
    Windows 10 Pro 64-bit
       #54

    Something's not working as expected. I really have two questions for two related threads and I'm not sure which to post this to. I'd like to get the Add_Open_command_window_here.reg working on right-click and Add_Shift+Open_command_window_here_as_administrator.reg working on shift-right-click.

    Problem One: Add_Open_command_window_here.reg adds the option to BOTH right-click and shift-right-click context menus. Add_Shift+Open_command_window_here.reg adds the option to the shift-right-click context menu only and removes it from the right-click menu. How can I reverse that? Both of those files otherwise work as expected and the window opens in the folder where I've right-clicked. There are no interim steps (i.e. UAC) involved.

    Problem Two: Add_Shift+Open_command_window_here_as_administrator.reg adds the "as admin" option to the shift-right-click menu and not to the right-click menu as desired. The problem occurs when I try to use the option. When I click on "Open command window here as administrator" a command window starts to open then I get a blank desktop and the UAC prompt for Windows Command Processor. If I allow it, I'm returned to a normal screen with the command window open, but I'm at the C:\ folder, NOT the folder I shift-right-clicked in. I can live with the UAC prompt, but not the C:\ starting point.
      My Computer

  6. Brink's Avatar
    Posts : 56,311
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #55

    Yar Notsew said:
    Something's not working as expected. I really have two questions for two related threads and I'm not sure which to post this to. I'd like to get the Add_Open_command_window_here.reg working on right-click and Add_Shift+Open_command_window_here_as_administrator.reg working on shift-right-click.

    Problem One: Add_Open_command_window_here.reg adds the option to BOTH right-click and shift-right-click context menus. Add_Shift+Open_command_window_here.reg adds the option to the shift-right-click context menu only and removes it from the right-click menu. How can I reverse that? Both of those files otherwise work as expected and the window opens in the folder where I've right-clicked. There are no interim steps (i.e. UAC) involved.

    Problem Two: Add_Shift+Open_command_window_here_as_administrator.reg adds the "as admin" option to the shift-right-click menu and not to the right-click menu as desired. The problem occurs when I try to use the option. When I click on "Open command window here as administrator" a command window starts to open then I get a blank desktop and the UAC prompt for Windows Command Processor. If I allow it, I'm returned to a normal screen with the command window open, but I'm at the C:\ folder, NOT the folder I shift-right-clicked in. I can live with the UAC prompt, but not the C:\ starting point.
    Hello Yar, and welcome to Ten Forums.

    It is by design from Windows to have the right click option available on both right click and Shift+right click.

    The Shift+right click option will only be available when you Shift+right click.

    Is the account actually using the context menu an administrator account or standard user account?

    What is the full path of the folder you trying to open in the elevated command prompt? Is this folder local, or on some network or external location?

    I'll use this info to test on my system to see if I get the same results.
      My Computers


  7. Posts : 3
    Windows 10 Pro 64-bit
       #56

    Hi Brink. Thanks for the welcome. This is on my personal computer and I am the admin. For testing, I've been right-clicking on my desktop but the problem occurs on any folder. C:\Program Files\Intel, for example, opens as
    Open command window here as administrator - Add in Windows 10-capture.jpg

    Shift-right-clicking in the same folder and choosing "Open command window here as administrator", gets me
    Open command window here as administrator - Add in Windows 10-capture2.jpg
      My Computer

  8. Brink's Avatar
    Posts : 56,311
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #57

    @Yar Notsew,

    Where is the [MARS] coming from in your command console?

    Is this some sort of custom command prompt using the prompt [MARS] type command made to be used by the context menu? For example, via Environment Variables??
      My Computers


  9. Posts : 3
    Windows 10 Pro 64-bit
       #58

    Yep, MARS is the computer name and I included it in the prompt of the Autorun value. I think I figured this out. HKLM\Software\Microsoft\Command Processor has a key of Autorun with a value I set long ago of
    prompt [%COMPUTERNAME%]$S$P$G&&cd /d c:\&&cls

    Notice the cd /d c:\ near the end which changes the drive and directory to c:\ when the command window opens regardless of where it was started from.

    Evidently, that key is used when the "Open command window here as administrator" option is chosen from the context menu. I replaced it with the value
    prompt [%COMPUTERNAME%]$S$P$G&&cls

    The "Open...administrator" option works correctly now.

    There's also an Autorun key under HKCU\Software\Microsoft\Command Processor which appears to override the HKLM Autorun. It did not have the cd /d c:\ value in the Autorun key so the prompt showed the current unchanged local path for the "Open command prompt here" option. I removed this key since the prompt from HKLM's Autorun is correct now.

    Then there's the key of HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe that doesn't have an Autorun key but does have other keys that effect the way the command window appears (font, colors, etc.) whether opened as an administrator or not. I also have
    HKEY_CURRENT_USER\Console\cmd.exe - Shortcut
    HKEY_CURRENT_USER\Console\Command Prompt
    HKEY_CURRENT_USER\Console\Elevated Command Prompt

    Those last three have keys like ColorTable and FaceName that would appear to change the appearance of the command window but changes there do not get reflected in the command window appearance so I suspect they're obsolete carryovers from Windows 7.

    Am I correct in thinking that HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe effects what I see in ALL command windows, HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor sets additional parameters for ALL command windows, and that HKEY_CURRENT_USER\Software\Microsoft\Command Processor can override some of those parameters but only for "Open command window here" and NOT for "Open command window here as administrator"?

    I think I have this sorted out now. I appreciate your help and patience.
      My Computer

  10. Brink's Avatar
    Posts : 56,311
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #59

    @Yar Notsew,

    Great news. I was thinking part of the command you used for the custom command prompt may have been what was causing the issue. I'm glad you got it sorted out.

    Yar Notsew said:
    Am I correct in thinking that HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe effects what I see in ALL command windows, HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor sets additional parameters for ALL command windows, and that HKEY_CURRENT_USER\Software\Microsoft\Command Processor can override some of those parameters but only for "Open command window here" and NOT for "Open command window here as administrator"?
    That sounds correct based on your testing and results.
      My Computers


 
Page 6 of 11 FirstFirst ... 45678 ... LastLast

Tutorial Categories

Open command window here as administrator - Add in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


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

Designer Media Ltd
All times are GMT -5. The time now is 04:13.
Find Us




Windows 10 Forums