0
Follow this please using path from registry in a batch file
Code:
for /f "tokens=2*" %%a in (' REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Web Start\1.0.1" /v Home') do set JavaPath=%%b
Output:
C:\Program Files\Java\jre8\bin
Question:
Can we add x86 in this path such as it points to C:\Program Files (x86)\Java\jre8\bin
?
i tried using
for /f "tokens=* delims=\J" %%a in ( %JavaPath% ) do set path_temp = %%b
But i get erro The system cannot find the file C:\Program.
tokens=*
means "put the tail (which is the whole string because none separate token numbers specified) into variable %%a".delims=\J
means that delimiter is both\
char andJ
char (not\J
substring!). – Akina – 2019-09-13T06:45:32.697