Search code examples
javacmdregistrytomcat7

reg add invalid syntax cmd


I want to change a registry key on commandline, but it says always wrong syntax. Maybe someone can help me. Here is my code:

reg add HKLM\Software\Wow6432Node\Apache Software Foundation\Procrun 2.0\tomcat7\Parameters\Java /v Jvm /t REG_SZ /d C:\Program Files (x86)\Java\jre7_2\bin\client\jvm.dll /f

I want to change the java path. Do I need anything for the spaces in the path(s)?

Thanks very much!


Solution

  • Try with

    reg add "HKLM\Software\Wow6432Node\Apache Software Foundation\Procrun 2.0\tomcat7\Parameters\Java" /v Jvm /t REG_SZ /d "C:\Program Files (x86)\Java\jre7_2\bin\client\jvm.dll" /f
    

    Values with spaces should be quoted to be handled as only one argument.