cmd error "The system cannot find the path specified."

5,024

I told you that this would be quick once you asked the question properly.

You state that you are running

cd $TMP
in Microsoft's command interpreter, cmd.

That is not the syntax used for environment variable expansion in Microsoft's command interpreter. The syntax is

cd %TMP%
. Yes, the trailing percent sign is important.

Share:
5,024

Related videos on Youtube

dw19
Author by

dw19

Updated on September 18, 2022

Comments

  • dw19
    dw19 over 1 year

    I am getting this error when I am doing a cd into a directory I stored in environment variables.

    But the thing is, when I cd into the same directory using the same ev using vim, I can successfully cd into that directory.

    This is true for all the directories stored in ev, even the $HOME path.

    Please help me out.

    The environment variable is setup like this:

    Name: dev Value: E:\Software Development

    Command: cd $dev or cd $HOME or cd $TMP

    Non of the commands are working. But in vim, :cd $dev does the job.

    Image:

    enter image description here

    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 9 years
      Did you edit the path in the System- or User-level environment variables? Are you sure you're running in the same user scope for both the command-prompt as you are with Vim? IE: Does Vim run "as administrator" by any chance, and/or are you opening the command prompt "as administrator"?
    • dw19
      dw19 over 9 years
      I am running both without administrator privileges. I have added the custom path to user level, and I just tried the System-level $TMP and even it doesn't work (have tried both cmd and cmder), but again in vim $TMP and all other ev seem to work.
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 9 years
      How exactly are you modifying the environment variables?
    • dw19
      dw19 over 9 years
      Through Advanced System Setting dialog.
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 over 9 years
      Bizarre, well based on what you're provided it should just work. There must be a piece missing from your info someplace...
    • dw19
      dw19 over 9 years
      I hope there is not, I am extremely frustrated, have to write the full path all the time. Everything was working fine a week ago.
    • dw19
      dw19 over 9 years
      That is the last resort, I hope I can work it out without that, and I really thought it's a common problem :|
    • JdeBP
      JdeBP over 9 years
    • dw19
      dw19 over 9 years
      Edited to add specific commands and link to image to show the problem.
  • Vitas
    Vitas over 9 years
    It seems like user3224858 is confusing cmd with powershell but it is strange anyway :o