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)?

link|improve this question

Which version of vim? This is not the behaviour of the :shell command within vim version 7.2, which quite happily spawns the command interpreter in whatever directory vim is itself in at the time. – JdeBP Jul 1 '11 at 15:26
feedback

1 Answer

up vote 3 down vote accepted

Navigate to the key HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor and search for the String Autorun in the left 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

Source

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.

link|improve this answer
+1 even though you deleted it. – KCotreau Jul 1 '11 at 14:59
I deleted it because I answered the question I perceived and not the question that was asked. It seems like the answer still applies though. Sorry for the confusion. – OrigamiRobot Jul 1 '11 at 15:24
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.