In trying to move to a folder called "Creating Project & External Execution"... with this command...

cd Creating Project & External Execution

This error occurs...

The system cannot find the path specified.
'External' is not recognized as an internal or external command, operable program or batch file.

Why does External in the folder name cause this problem?

  • Welcome to SuperUser. Can you post a screenshot of the typed command before you press return?– SteseMay 15 '17 at 13:04
  • 1
    It's not the 'External' that's causing the problem, it's the &, which has a special meaning to CMD. You may find this SS64 reference page useful.– Jeff ZeitlinMay 15 '17 at 13:09
  • The folder name has to be inside double quotes " " to be reading spaces. For example cd "Program Files"– me_alokMay 15 '17 at 13:16
  • @me_alok cd Program Files work as well. cd doesn't need quotes for file name with spaces. cd /? gives this CHDIR command does not treat spaces as delimiters, so it is possible to CD into a subdirectory name that contains a space without surrounding the name with quotes The only problem here is the &.– Lưu Vĩnh PhúcMay 15 '17 at 15:13
  • @LưuVĩnhPhúc Thank you, i guess i usually followed what tab key said. The tab audo-completion adds quotes which made me think it does require quotes.– me_alokMay 15 '17 at 15:41

Of course it does. The command you must issue is:

cd "Creating Project & External Execution"

In this screenshot, you see that I have first issued your command, and then the one I recommended above, as well the results of each.

Your command vs. my command

The command that you are issuing is equal to the following two commands:

cd Creating ProjectExternal Execution

The first results in this error:

The system cannot find the path specified.

And the second results in this error:

'External' is not recognized as an internal or external command,operable program or batch file.

    You have to put the folder name between quotation mark " and ", that will be like that :

    cd "your folder name"
    • you don't need to put folder name in quotes. cd some folder absolutely works without problem. The problem here is the & character– Lưu Vĩnh PhúcMay 15 '17 at 15:12

    In Windows cmd & is a special character used for separating multiple commands on a single line

    & [...] command1 & command2 

    Use to separate multiple commands on one command line. Cmd.exe runs the first command, and then the second command.

    https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true

    As a result cd Creating Project & External Execution will be executed as

    cd Creating ProjectExternal Execution

    as Fleet Command have said. Since there's no folder called "Creating Project" and no command named External, you got the above errors.


    To solve this you have to escape the & somehow. There are 2 ways:

    • Put quotes around the name because inside quotes & loses its special meaning

    If it is a quote (") toggle the quote flag, if the quote flag is active, the following special characters are no longer special: ^ & | < > ( ).

    How does the Windows Command Interpreter (CMD.EXE) parse scripts?

    cd "Creating Project & External Execution"
    • Escape with ^
    cd Creating Project ^& External Execution

    No need to escape the spaces because cd works fine with spaces in filename1. But if you want you can still escape the spaces like this cd Creating^ Project^ ^&^ External^ Execution without problem

    cmd

    1Space is not a delimiter in cd

    C:\>cd /?Displays the name of or changes the current directory.CHDIR [/D] [drive:][path]CHDIR [..]CD [/D] [drive:][path]CD [..].. Specifies that you want to change to the parent directory....CHDIR command does not treat spaces as delimiters, so it is possible toCD into a subdirectory name that contains a space without surroundingthe name with quotes. For example:cd \winnt\profiles\username\programs\start menuis the same as:cd "\winnt\profiles\username\programs\start menu"which is what you would have to type if extensions were disabled.

      Your Answer

       
      discard

      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.