cmd.exe starts in %userprofile%
when I start it normally. When I start it from vim, it starts in %systemroot%\system32
.
How can I change this so it starts in a folder of my choice (from vim)?
Navigate to the key HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor and search for the String Autorun in the right window. If that string is not existing yet create it as a "String Value". Double-click it afterwards and add the new directory path in the following way:
CD /d %systemroot%\system32
It looks like cmd.exe isn't using %systemroot%\system32 as it's starting path when running from vim. %systemroot%\system32 is just where cmd.exe is located. The working directory is still the same as when starting cmd normally.
:shell
command within vim version 7.2, which quite happily spawns the command interpreter in whatever directory vim is itself in at the time.