how to create registry key through java program?

前端 未结 3 1816
没有蜡笔的小新
没有蜡笔的小新 2020-12-21 04:32

I want to create registry key through java program to add the jar file in the start up.

RegistryKey r=new RegistryKey(RootKey.HKEY_CURRENT_USER,\"Software/Mi         


        
3条回答
  •  情歌与酒
    2020-12-21 05:00

    Add the JRegistryKey.jar in the library.
    Then copy and paste JRegistryKey.dll in my project.

    After that I run the same program ,The registry key is created successfully.

    RegistryKey r=new RegistryKey(RootKey.HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run");
            RegistryValue v=new RegistryValue("name or the registrykey",ValueType.REG_SZ,"my jar file path");
            r.setValue(v);
    

提交回复
热议问题