devjta / java-registry

Automatically exported from code.google.com/p/java-registry
1 stars 4 forks source link

It seems can not work on Windows 7? #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
How to run reg.exe or regedit.exe as an administrator?
Thanks!!

private void initNatvieRegistry() throws RegistryErrorException
  {
    try{
      Runtime.getRuntime().exec("reg.exe"); //if no exception is thrown, 
then reg.exe was successfull
      //ARSCH
//      nativeHandler = new RegHandler(); //reg.exe handler
      nativeHandler = new RegeditHandler();
    }
    catch(Exception ex)
    {
      //no check for regedit.exe because of vista uac control
      nativeHandler = new RegeditHandler();
    }
  }

Original issue reported on code.google.com by stjohnn...@gmail.com on 10 Apr 2010 at 10:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
    public String getRegistryValue(String keyPath, String keyName){
        String value = null;
        try {
            at.jta.Regor reg = new at.jta.Regor();
            at.jta.Key key = new at.jta.Key();
            key.setPath(keyPath);
            if(key._isValidKey()){
                value = reg.readAnyValueString(key, keyName);
            }
        } catch (at.jta.RegistryErrorException ex) {
            Logger.getLogger(AppFunctions.class.getName()).log(Level.SEVERE, null, ex);
        }
        return(value);
    }

Original comment by neal.gar...@gmail.com on 11 Jul 2010 at 7:28

GoogleCodeExporter commented 9 years ago
Should work with latest revision..
I submitted the testcode ;)

Original comment by bEha...@gmail.com on 21 Jan 2011 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by bEha...@gmail.com on 22 Feb 2012 at 3:30