문제

I need to insert a value into registry in a batch file. The value contains quotes and that makes it hard to insert.

set OPENCOMMAND="\"%JAVAHOME%\bin\javaw.exe\" -jar \"%%1\" %%*\""
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command" /v "" /t REG_SZ /d %OPENCOMMAND%

This results almost in the correct result except that the value contains quotes around it in the reqistry.

"C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*"

That's what the registry contains and what it should contain is

C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %*

What to do?

도움이 되었습니까?

해결책

This script should work:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command" /v "" /t REG_SZ /d "\"%JAVAHOME%\bin\javaw.exe\" -jar \"%%1\" %%*"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top