How to avoid% in cmd setx?

I am trying to install var on a cmd script, but there was a problem,

setx /M JAVA_HOME "D:\Tool\JDK" setx /M PATH "%PATH%;%JAVA_HOME%\bin;D:\TZProfile\!!!QuickLink\" 

I want to add% JAVA_HOME% \ bin to PATH, no "D: \ Tool \ JDK"

+6
source share
1 answer

At the command line, use ^ to exit, e.g.

 ^%JAVA_HOME^% 

In a batch file, use % to exit, for example,

 %%JAVA_HOME%% 
+9
source

Source: https://habr.com/ru/post/890839/


All Articles