Search This Blog

Tuesday, October 5, 2010

How to use Java Runtime.exec() with Windows REG utility to Read/Update/Delete entries in HKEY_LOCAL_MACHINE\...\CurrentVersion\Run?

Programmer Question

I want to use Runtime.exec() to update the registry for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
using the Windows REG command utility.



Need to be able to add/remove/read an entry from the "Run" key to allow my Swing application to run at startup and check if it is configured to run at startup so I can mark the option as checked or unchecked in the GUI. I had this working with JNI but the library was 32bit only so it doesn't work on 64bit. I'm thinking this will be a better approach. Don't even need to include a library this way and I don't think REG is going away or changing.



Has anyone done this before or know how to do this?



Thanks!



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails