Home » Questions » Computers [ Ask a new question ]

Windows 7 Administrator Command Prompt "Start in" Path

Windows 7 Administrator Command Prompt "Start in" Path

So, I know you can create a shortcut to an administrator-level command prompt (as described in this question), but what I'm seeing is that whenever I use such a shortcut, it always drops me into c:\windows\system32\ path.

Asked by: Guest | Views: 300
Total answers/comments: 5
Guest [Entry]

"I found a way around this. In the shortcut, change the command line to:

C:\Windows\System32\cmd.exe /k ""cd c:\""

In this case it changes the starting directory to the root of C:. You can set your own parameters."
Guest [Entry]

"Launch an elevated Command Prompt from the context menu

To add the Open Command Window Here (Administrator) option to the context menu for file system folders, use the following REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=""Open Command Window Here (Administrator)""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=""cmd.exe /s /k pushd \""%V\""""

To add the entry to Computer (My Computer) context menu, use the following REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas]
@=""Open Command Prompt (Administrator)""

[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas\command]
@=""cmd.exe""

Usage

Copy the above contents to Notepad, and save the file with .REG extension. Then right-click the REG file and choose Merge.

Source"
Guest [Entry]

"Update on @Molly7244's answer.

Add nice icons
Only visible on Shift (as you are used to with standard cmd window)
Hotkey on 'a'

Windows Registry Editor Version 5.00

;Add 'Open command window here (Administrator)' context menu
;Extended means it shows on shift key
;Hotkey on 'a'

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@=""Open command window here (&Administrator)""
""Extended""=""""
""NoWorkingDirectory""=""""
""Icon""=""C:\\Windows\\system32\\imageres.dll,-5324""

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@=""cmd.exe /s /k pushd \""%V\""""

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=""Open command window here (&Administrator)""
""Extended""=""""
""NoWorkingDirectory""=""""
""Icon""=""C:\\Windows\\system32\\imageres.dll,-5324""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=""cmd.exe /s /k pushd \""%V\""""

;Add icon also to standard 'Open command window here'

[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
""Icon""=""C:\\Windows\\system32\\imageres.dll,-5323""

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
""Icon""=""C:\\Windows\\system32\\imageres.dll,-5323"""
Guest [Entry]

You can right click CMD, select Properties and in the "Start in" box clear whatever is there, entering: %SystemRoot%\system32. Click OK.
Guest [Entry]

"The correct answer was given by Peter, but if you want to switch to a drive other than c: (assuming Windows is on c:) is to use

C:\Windows\System32\cmd.exe /k ""cd /d d:\some_directory"""