Setting mongodb editor path to mongorc on windows

I am trying to set the path to the sublime text editor for mongodb in .mongorc.js in windows 8, so I am adding this line to .mongorc.js ...

EDITOR = "C:\\Program Files\\Sublime Text 3\sublime_text.exe";

which when i run mongo.exe from the command line and then type:

> edit blah

it returns:

'C\Program' is not recognized as an internal or external command

so i try

EDITOR = "C:\\Program\u0020Files\\Sublime\u0020Text\u00203\\sublime_text.exe";

and even

EDITOR = "C:\\Program%20Files\\Sublime%20Text%203\\sublime_text.exe";

and i get

The system cannot find the path specified.

+4
source share
2 answers

Apparently, the path cannot contain spaces.

The simplest workaround for this is to use 8.3 generated names for folders, not paths with spaces.

/x, 8.3 :

c:
cd \
dir pro* /x

- :

Directory of C:\

11/05/2013  07:19 PM    <DIR>          PROGRA~1     Program Files
11/05/2013  07:19 PM    <DIR>          PROGRA~2     Program Files (x86)

64- Sublime, PROGRA~1.

Program Files:

cd Program Files

Sublime 8.3:

C:\Program Files>dir Subl* /x

 Directory of C:\Program Files

 09/08/2013  02:17 PM    <DIR>          SUBLIM~1     Sublime Text 2

SUBLIM~1. EDITOR, , :

EDITOR="C:\\PROGRA~1\\SUBLIM~1\\sublime_text.exe"

- ( ), ( , ). Sublime , edit MongoDB , , .

+2

, , . , , wordpad.

> EDITOR="\"C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe\""
"C:\Program Files\Windows NT\Accessories\wordpad.exe"
> edit a

. , .

, / , EDITOR.

+6

All Articles