windows - setlocal enabledelayedexpansion in batch file -


setlocal enabledelayedexpansion /f "skip=2 tokens=2*" %%a in ('reg query "hklm\software\javasoft\java development kit\1.6" /v javahome') set javapath=%%b setx -m java_home "%javapath%" echo java__path variable: !javapath! echo java__path: %java_home% 
  • am setting java home registry.
  • the values getting set.
  • setx working.

when try echo using !javapath!, getting value , when tried echo %java_home%, value empty.

i tried enabledelayedexpansion no use. how echo %java_home%??

follow setx set reset local variable.

setx -m java_home "%javapath%" set "java_home=%javapath%" 

if these within loop use !variable! syntax.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -