Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'C:\' in CMD, the filename, directory name, or volume label syntax is incorrect

Recently started trying to learn java and the first thing I needed to do was to make a PATH variable. My path variable looks like this.

C:\Users\Collin>echo %path%
'C:\Program Files(x86)\Java\jdk1.7.0_40\bin';C:\Windows;C:\Windows\system32;
'C:\Program Files(x86)\Java\jdk1.7.0_40\bin';C:\Windows;C:\Windows\system32;

So, I attempt to use javac to see if path did work. Javac did not work, showing the error of not recognized as an internal or external command, operable program, or batch file. I then tried just using path and I got this:

C:\Users\Collin>%path%
The filename, directory name, or volume label syntax is incorrect.

I then tried to just use basic explorer paths such as 'C:\' and tried another drive as 'G:\'. I've tried almost every variation of quotations and formatting but nothing seems to work.

C:\Users\Collin>C:\
'C:\' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Collin>'C:\'
The filename, directory name, or volume label syntax is incorrect.

C:\Users\Collin>"C:\"
'"C:\"' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Collin>'G:\'
The filename, directory name, or volume label syntax is incorrect.

I'm running Windows 7 Ultimate 64-bit as my OS. Will I have to just format my HDD? This seems to be a problem with the registry, and as such I'm thinking that I will have to format and reinstall. But, maybe there is something I didn't catch that you guys can? Any help would be greatly appreciated, even if you tell me I have to format. Thanks in advance.

like image 813
Collin Tinen Avatar asked Sep 21 '13 16:09

Collin Tinen


Video Answer


2 Answers

  1. press Windows-key and Pause-key together WinPause
  2. select "Advanced system settings"
  3. in "System Properties" press the button "Environment Variables"
  4. select "Path" in the upper part and press "Edit...":

    enter image description here

  5. append ;%ProgramFiles(x86)%\Java\jdk1.7.0_40\bin to the path:

    enter image description here

  6. OK
like image 98
Endoro Avatar answered Oct 20 '22 00:10

Endoro


Instead of

C:\program files\

put

C:\progra~1\

like image 29
mmimis85 Avatar answered Oct 19 '22 23:10

mmimis85