I want to move to another directory in Node.js command prompt but when I open the Node.js cmd window it doesn't show me any path. Here is the screenshot of the Node.js cmd window:
Now if i want to change directory to D:\abc
then how can i do it here?
.help will show you all the options. Do .exit in this case
Add the \d [dir] attribute to the cd command like this:
cd \d %yourdir%:\
To switch to the another directory process.chdir("../");
If you mean to change default directory for "Node.js command prompt", when you launch it, then (Windows case)
change the default path in the row which looks like
if "%CD%\"=="%~dp0" cd /d "%HOMEDRIVE%%HOMEPATH%"
with your path. It could be for example
if "%CD%\"=="%~dp0" cd /d "c://MyDirectory/"
if you mean to change directory once when you launched "Node.js command prompt", then execute the following command in the Node.js command prompt:
cd c:/MyDirectory/
Type .exit in command prompt window, It terminates the node repl.
nodevars.bat
"%HOMEDRIVE%%HOMEPATH% /file1/file2/file3
nodevars.bat
This work even with Swedish words
Source: Stackoverflow.com