When I start an elevated Command Prompt in Windows 7 or Windows Vista, the initial directory is the %SystemRoot%\system32
directory.
This is the default Windows behavior, and is not a problem specific to my system, so I'm not expecting some sort of "bug fix" here, but rather a tweak to "fix" the default behavior.
To repro:
- Click Start
- Type cmd.exe
- Hit Ctrl+Shift+Enter
- When the elevation prompt appears, select
Yes
Expected:
- The initial directory is my user profile directory, e.g.
C:\Users\merlyn
Actual:
- The initial directory is the system32 directory,
C:\Windows\system32
I'd like this be easy to work with. I'd like it to apply to all cmd.exe prompts/shortcuts, regardless of where they're started from. E.g. I'd like it to automatically apply to my Visual Studio Command Prompt (2010)
without having to modify that specific shortcut.
I'd like this to be safe so that batch files aren't broken by my fixes.
Is there an easy and safe way to get any elevated command prompt to start in the %UserProfile%
directory by default?