/* 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("
" + prefix[i] + runkeys[i][j] + " | \r\n");
if(runkey!=null) {
int valuecount = runkey.getValueCount() ;
if(valuecount==0)
strb.append("|
(---- No values defined for this key ----) | " + valuenames[valnum] + " | " + (String)runkey.getValue(valuenames[valnum]) +" | \r\n"); } // end for } // end if else strb.append("
(---- Key is not defined ----) |