12

When I build my project in netbeans me it shows:

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

I'm using jdk 8 and maven 3.3. My path system variable is:

%SystemRoot%\system32;%SystemRoot%;D:\POS\apache-maven-3.3.3-bin\apache-maven-3.3.3\bin;
Drashti Pandya
  • 348
  • 1
  • 5
  • 15
  • 1
    The question is not clear enough. Would you explain a little bit ? – orvi Aug 16 '15 at 13:37
  • 2
    possible duplicate of [CMD not recognised in Maven](http://stackoverflow.com/questions/14491928/cmd-not-recognised-in-maven) – solar Aug 16 '15 at 13:48
  • Possible duplicate of ['make' is not recognized as an internal or external command, operable program or batch file - Windows 7](https://stackoverflow.com/questions/23723364/make-is-not-recognized-as-an-internal-or-external-command-operable-program-or) – user10089632 Sep 01 '17 at 22:08

5 Answers5

20

So far I understand this is not your IDE issue.Check your "system32" is correctly defined in the PATH environment variable .

Path = %SystemRoot%\system32;
orvi
  • 3,142
  • 1
  • 23
  • 36
4

you can get it worked in anyone of below ways

  1. Set path to system32 c:\windows\system32 instead of %SystemRoot%\system32
  2. Go to system32 folder then search and find cmd.exe
  3. Use command instead of cmd.exe
Sasikumar Murugesan
  • 4,412
  • 10
  • 51
  • 74
2

One variable named Path was already set but i created a new variable which is PATH so it replaced the Path variable so Path = %SystemRoot%\system32; got deleted.

SO the conclusion is you were trying to install java or maven and you replaced Path with PATH and its gone.

So set the SystemRoot path in environment variable something like below.

PATH = %JAVA_HOME%\bin;%M2_HOME%\bin;%SystemRoot%\system32;

Alien
  • 15,141
  • 6
  • 37
  • 57
1

We can get cmd.exe with already setted System root path in very simple way

  1. simply copy cmd.exe from Windows/System32 folder and paste it in directory where it is needed.
Arshad Ali
  • 93
  • 1
  • 6
  • 1
    although this would work, it's a bad idea, to work around a misconfigured system instead of correcting the real problem. – Stephan Nov 02 '16 at 15:48
0

And easy workaround without using the environment variables path is to put the full path to the exe file as shown in the example below. First command doesn't work...Second works after putting the full location.

enter image description here

Chadee Fouad
  • 2,630
  • 2
  • 23
  • 29