Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid syntax. Default option is not allowed more than '2' time(s)

I am having trouble understanding why I am getting this error:

ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.

Implementation

C:\Users>setx JAVA_HOME "C:\DOC\JDK64\1.8.0.74"

SUCCESS: Specified value was saved.

C:\Users>setx PATH "%PATH%;%JAVA_HOME%\bin"
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.

C:\Users>setx PATH "%PATH%;%JAVA_HOME%bin"
ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).
Type "SETX /?" for usage.
like image 545
user Avatar asked Jun 15 '16 17:06

user


1 Answers

It is quite simple but hidden. run setx /? and I suppose the answer is there. The PATH you give as a parameter (string) contains space/spaces. You should enclose the PTH between "".

like image 187
Moty Avatar answered Nov 08 '22 15:11

Moty