/* Java applet for Win32 using WFC classes; Accesses registry Keys corrsponding to the various Win32 Run keys; these keys determine which applications run automatically on startup M. Gallant Security Development 07/05/2000 */ import com.ms.wfc.app.Registry; import com.ms.wfc.app.RegistryKey; public class RunKeyValuesApplet extends java.applet.Applet{ private static String [] prefix = {"HKEY_LOCAL_MACHINE\\", "HKEY_CURRENT_USER\\" } ; private static String [] HKLMrunkeys = { "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", "Software\\Microsoft\\Windows\\CurrentVersion\\RunServices", "Software\\Microsoft\\Windows\\CurrentVersion\\RunServicesOnce", "Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\Setup" } ; private static String [] HKCUrunkeys = { "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce" } ; private static String [][] runkeys = {HKLMrunkeys, HKCUrunkeys}; private static String subkeypath = "Software\\Microsoft\\SystemCertificates\\My\\Certificates"; public String keyvalueshtml() { StringBuffer strb = new StringBuffer(); strb.append("RunKeyValues\r\n"); strb.append("

Win32 Run Registry Keys

\r\n
\r\n"); RegistryKey runkey = null; int keytypes = runkeys.length ; for(int i = 0; i\r\n"); if(runkey!=null) { int valuecount = runkey.getValueCount() ; if(valuecount==0) strb.append("\r\n"); String [] valuenames = runkey.getValueNames() ; for(int valnum=0; valnum\r\n"); } // end for } // end if else strb.append("\r\n"); } strb.append("

  " + prefix[i] + runkeys[i][j] + "
(---- No values defined for this key ----)
" + valuenames[valnum] + "" + (String)runkey.getValue(valuenames[valnum]) +"
(---- Key is not defined ----)
") ; return strb.toString() ; } public static void main(String args[]) { if(args.length>0){ // System.out.println(keyvalueshtml()); return; } RegistryKey runkey = null; int keytypes = runkeys.length ; for(int i = 0; i