public static void setValue ( String branch , String entry , short type , String value ) throws RegistryException , IOException , InterruptedException { if ( type == RegistryEntry . TYPE_KEY ) { String fullKey = ListUtil . trim ( branch , "\\" ) + "\\" + ListUtil . trim ( entry , "\\" ) ; // String[] cmd = new String[]{"reg","add",cleanBrunch(fullKey),"/ve","/f"}; String [ ] cmd = new String [ ] { "reg" , "add" , cleanBrunch ( fullKey ) , "/f" } ; executeQuery ( cmd ) ; } else { if ( type == RegistryEntry . TYPE_DWORD ) value = Caster . toString ( Caster . toIntValue ( value , 0 ) ) ; String [ ] cmd = new String [ ] { "reg" , "add" , cleanBrunch ( branch ) , "/v" , entry , "/t" , RegistryEntry . toStringType ( type ) , "/d" , value , "/f" } ; executeQuery ( cmd ) ; } }
writes a value to registry