Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got the following error trying to edit a file on a UNC path using vim. How do I resolve this?

> new-psdrive x filesystem \\\c$
> cd x:\
> vim .\test.txt
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
share|improve this question
up vote 3 down vote accepted

If you launch vim with vim.bat, it launches cmd.exe and runs vim.exe from there. cmd.exe doesn't like UNC paths unless you disable the check like others have suggested. Powershell doesn't require you to disable this.

What you want to do is either always launch vim like:

   vim.exe .\test.text

Or else, get rid of vim.bat (usually created in C:\Windows\system32) and make sure vim.exe is in your $Path.

share|improve this answer

I don't think the problem is vim. Read this.

share|improve this answer
I think you are right. I included the details about vim and powershell because I am looking for a way to edit the file in vim without leaving powershell. For example, I am able to use the 'Edit with Vim' context menu item from the windows explorer to edit files on a UNC path. That is not an ideal work around since it requires me to leave powershell. – Eric Weilnau Jul 15 '10 at 16:39
You also might find this interesting if you haven't read it yet.… – John Jul 15 '10 at 17:38

You can make a simple add/edit in the registry:

  1. Go to HKCU\Software\Microsoft\Command Processor
  2. Create a new DWORD value called DisableUNCCheck
  3. Set the value to 1

After I did this I was able to use vim just fine without problems (probably will make it so my python/ruby stuff complains less too).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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