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 $TMPin 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.
Related videos on Youtube
Author by
dw19
Updated on September 18, 2022Comments
-
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:
-
Ƭᴇcʜιᴇ007 over 9 yearsDid 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 over 9 yearsI 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 over 9 yearsHow exactly are you modifying the environment variables?
-
dw19 over 9 yearsThrough Advanced System Setting dialog.
-
Ƭᴇcʜιᴇ007 over 9 yearsBizarre, well based on what you're provided it should just work. There must be a piece missing from your info someplace...
-
dw19 over 9 yearsI 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 over 9 yearsThat is the last resort, I hope I can work it out without that, and I really thought it's a common problem :|
-
JdeBP over 9 yearsIf you show people the exact commands that you told the computer to run rather than expect them to guess, then you'll probably find this cleared up in short order.
-
dw19 over 9 yearsEdited to add specific commands and link to image to show the problem.
-
-
Vitas over 9 yearsIt seems like user3224858 is confusing cmd with powershell but it is strange anyway :o