cls ; IF setconsole("hide") ; ENDIF ; ; NT/95 cleanup - Kixtart 4.00 ; ; (c) scripting@wanadoo.nl - 2000, 2001 ; ; vs 2.06 - program (cleanup recent list, set HKCR keys, set BOOT.INI, set TaskMgr) ; ; 1.00 (20000715) original version ; 2.00 (20010325) - add: cleanup additional applications, ; install locations, ; temporary files, ; - clean windows NT/9x environment: appdata, cache, cookies, recent. ; - change values for winzip32.ini file. ; - additional screen information. ; - create eventlog information entry. ; - create additional log files by external program LOG.COM ; normally: it will create "c:\ndos.log" + "c:\ndos.lst" files. ; - create "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" entry ; requirements: kix32.exe (= locate kix32.exe program) ; c:\work\cleanup.kix (= script file) ; - rep: redirect output to "c:\kix-info.log". ; simplification of some while/loop structures. ; - fix: correction for updating taskmgr registry settings for NT + W2K. ; 2.01 (20010325) - fix: correction for creation of "HKCR\unknown" registry settings. cleanup key first. ; 2.02 (20010401) - add: kixtart 2001 beta1 compliancy (fix ReadType) ; - add: introduction of "$debug_file" ; 2.03 (20010401) - fix: kixtart 2001 beta1 problem with arrays (urgent) ; 2.04 (20010405) - add: user information about output generation ; 2.05 (20010701) - rep: replace DIM by REDIM (Kixtart 4.00 RC 1) ; 2.06 (20011120) - add: "windows XP" ; - rep: suppress SetConsole("hide") ; ; external program: log.com (optional) ; $prgrm_version="2.06" IF (Instr("-4.00-",substr(@kix,1,1)) = 0) ? "Informative CLEANUP: run script with version KIX 4.00" EXIT ENDIF ; --------------------------------------------------------------------------- ; - site defined settings - ; --------------------------------------------------------------------------- $prgrm_name="c:\work\cleanup.kix" ; - value used for registry entry - ; $debug_mode="yes" ; - no/yes - for additional information about checking registry keys - ; - no = no information - ; - yes = information will be written to "$debug_file" - $debug_file="c:\kix-info.log" ; --------------------------------------------------------------------------- ; - - ; --------------------------------------------------------------------------- IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF ; break off flushkb $info="" $time_start=@time ; IF (exist($debug_file) = 1) del $debug_file ENDIF IF ($debug_mode = "yes") break on IF (RedirectOutput($debug_file,1) = 0) ENDIF ; IF ($NT_mode = "yes") ? "KIX-CLEANUP: DEVELOPMENT (NT - kixtart "+@kix+" vs "+$prgrm_version+")" ELSE ? "KIX-CLEANUP: DEVELOPMENT (95 - kixtart "+@kix+" vs "+$prgrm_version+")" ENDIF ? ELSE IF ($NT_mode = "yes") ? "KIX-CLEANUP: PRODUCTION (NT - kixtart "+@kix+" vs "+$prgrm_version+")" ELSE ? "KIX-CLEANUP: PRODUCTION (95 - kixtart "+@kix+" vs "+$prgrm_version+")" ENDIF ? IF (RedirectOutput("nul",1) = 0) ENDIF ENDIF flushkb IF ($debug_mode <> "yes") IF setconsole("hide") ENDIF ENDIF ; -------------------------------------------------------------------------- ; - taskmgr settings. all counters - ; -------------------------------------------------------------------------- $os="" $os_dos=@dos SELECT CASE ($NT_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP - $os="XP" CASE ($NT_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 - $os="W2K" CASE ($NT_mode = "yes") ; - Windows NT - $os="NT4" CASE ($NT_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME - $os="ME" CASE ($NT_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 - $os="W98" CASE ($NT_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 - $os="W95" CASE 1 $os="???" ; - undetermined - ENDSELECT ; $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\TaskManager" IF (ExistKey($ikey) = 0) AND ($NT_mode = "yes") $ikey_ex="preferences" ; IF ($os = "NT") ; - Windows NT - $taskmgr_prefs= "ac000000a00f00000200000001000000020000000000000020" $taskmgr_prefs=$taskmgr_prefs+"000000de030000d70200000200000000000000010000000200" $taskmgr_prefs=$taskmgr_prefs+"00000300000004000000050000000600000007000000080000" $taskmgr_prefs=$taskmgr_prefs+"00090000000a0000000b0000000c0000000d000000ffffffff" $taskmgr_prefs=$taskmgr_prefs+"6b000000320000002300000046000000460000004600000046" $taskmgr_prefs=$taskmgr_prefs+"000000460000004600000046000000460000003c0000003c00" $taskmgr_prefs=$taskmgr_prefs+"00003c000000460000004b0000000000000000000000" ENDIF IF ($os = "W2K") ; - Windows 2000 - $taskmgr_prefs= "70010000e80300000200000001000000010000000a0000000a" $taskmgr_prefs=$taskmgr_prefs+"0000009e010000c90100000100000000000000010000000400" $taskmgr_prefs=$taskmgr_prefs+"000005000000060000000700000008000000090000000a0000" $taskmgr_prefs=$taskmgr_prefs+"000b0000000c0000000d0000000e0000000f00000010000000" $taskmgr_prefs=$taskmgr_prefs+"11000000120000001300000014000000150000001600000017" $taskmgr_prefs=$taskmgr_prefs+"00000018000000ffffffffffffffffffffffff6b0000003200" $taskmgr_prefs=$taskmgr_prefs+"00002300000046000000460000006400000046000000460000" $taskmgr_prefs=$taskmgr_prefs+"00460000004600000046000000460000003c0000003c000000" $taskmgr_prefs=$taskmgr_prefs+"3c0000003c0000003c00000046000000460000004600000046" $taskmgr_prefs=$taskmgr_prefs+"0000004600000046000000ffffffffffffffffffffffff0000" $taskmgr_prefs=$taskmgr_prefs+"00000100000002000000030000000400000005000000060000" $taskmgr_prefs=$taskmgr_prefs+"000700000008000000090000000a0000000b0000000c000000" $taskmgr_prefs=$taskmgr_prefs+"0d0000000e0000000f00000010000000110000001200000013" $taskmgr_prefs=$taskmgr_prefs+"000000140000001500000016000000ffffffffffffffffffff" $taskmgr_prefs=$taskmgr_prefs+"ffffc7000000000000000000000000000000" ENDIF IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $result_data_type=ReadType($ikey, $ikey_ex) IF (@error <> 0) OR (len($result_data_type) = 0) $result_data_type="REG_BINARY" ENDIF ELSE $result_data_type="REG_BINARY" ENDIF IF (ReadValue($ikey, $ikey_ex) <> $taskmgr_prefs) IF (writevalue($ikey, $ikey_ex, $taskmgr_prefs, $result_data_type) <> 0) IF (writevalue($ikey, $ikey_ex, $taskmgr_prefs, "REG_BINARY") <> 0) ENDIF ENDIF $info=$info+" taskmgr."+$ikey_ex IF ($debug_mode = "yes") ? " taskmgr.["+$ikey_ex+"]="+$ivalue ENDIF ENDIF ENDIF ; -------------------------------------------------------------------------- ; - update BOOT.INI timer - ; -------------------------------------------------------------------------- IF ($NT_mode = "yes") $filename="c:\boot.ini" ; - NT boot menu - $file_attr=getfileattr($filename) IF setfileattr($filename, 128) ENDIF IF (readprofilestring($filename, "boot loader", "timeout") <> "1") IF (writeprofilestring($filename, "boot loader", "timeout", "1") = 0) $info=$info+" boot.timeout=1" IF ($debug_mode = "yes") ? " "+$filename+" (attr: "+$file_attr+") -> [boot loader] timeout=1" ENDIF ENDIF ENDIF IF setfileattr($filename, $file_attr) ENDIF ENDIF ; -------------------------------------------------------------------------- ; - create "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" entry - ; -------------------------------------------------------------------------- $ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" $default_key="kix-cleanup" $default_value="kix32.exe "+$prgrm_name IF (Exist("c:\windows\kix32.exe") = 1) $default_value="c:\windows\kix32.exe "+$prgrm_name ENDIF IF (Exist("c:\winnt\kix32.exe") = 1) $default_value="c:\winnt\kix32.exe "+$prgrm_name ENDIF IF (Exist($prgrm_name) = 1) IF (ExistKey($ikey) = 0) IF (ReadValue($ikey, $default_key) <> $default_value) IF (writevalue($ikey, $default_key, $default_value, "REG_SZ") = 0) ENDIF $info=$info+" "+$default_key+"='"+$default_value+"'" ENDIF ENDIF ENDIF ; -------------------------------------------------------------------------- ; - add "Quickview with Notepad" to menu, when no file association exist - ; -------------------------------------------------------------------------- ; - enabling 'quickview with notepad' - IF (ExistKey("HKEY_CLASSES_ROOT\unknown") <> 1) $result=DelTree("HKEY_CLASSES_ROOT\unknown") $result=AddKey("HKEY_CLASSES_ROOT\unknown") $result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell") $result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell\open") $result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell\open\command") ENDIF ; $ikey="HKEY_CLASSES_ROOT\unknown\Shell\open" $ikey_ex=ENUMVALUE($ikey, 0) $default_notepad="Quickview with Notepad" IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $result_data_type=ReadType($ikey, $ikey_ex) IF (@error <> 0) OR (len($result_data_type) = 0) $result_data_type="REG_SZ" ENDIF ELSE $result_data_type="REG_SZ" ENDIF IF (writevalue($ikey, $ikey_ex, $default_notepad, $result_data_type) = 0) IF (writevalue($ikey, $ikey_ex, $default_notepad, "REG_SZ") = 0) ENDIF ENDIF ; $ikey="HKEY_CLASSES_ROOT\unknown\Shell\open\command" $ikey_ex=ENUMVALUE($ikey, 0) $default_notepad_exe="notepad.exe %1" IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $result_data_type=ReadType($ikey, $ikey_ex) IF (@error <> 0) OR (len($result_data_type) = 0) $result_data_type="REG_SZ" ENDIF ELSE $result_data_type="REG_SZ" ENDIF IF (writevalue($ikey, $ikey_ex, $default_notepad_exe, $result_data_type) = 0) IF (writevalue($ikey, $ikey_ex, $default_notepad_exe, "REG_SZ") = 0) ENDIF ENDIF ; -------------------------------------------------------------------------- ; - change "regfile" + "vbsfile" to edit mode - ; -------------------------------------------------------------------------- $ikey="HKEY_CLASSES_ROOT\regfile\shell" $ikey_ex=ENUMVALUE($ikey, 0) $default_key="edit" IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $result_data_type=ReadType($ikey, $ikey_ex) IF (@error <> 0) OR (len($result_data_type) = 0) $result_data_type="REG_SZ" ENDIF ELSE $result_data_type="REG_SZ" ENDIF IF (ReadValue($ikey, $ikey_ex) <> $default_key) IF (writevalue($ikey, $ikey_ex, $default_key, $result_data_type) = 0) IF (writevalue($ikey, $ikey_ex, $default_key, "REG_SZ") = 0) ENDIF ENDIF IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $info=$info+" "+$ikey+"="+$default_key ENDIF ENDIF ; $ikey="HKEY_CLASSES_ROOT\vbsfile\shell" $ikey_ex=ENUMVALUE($ikey, 0) $default_key="edit" IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $result_data_type=ReadType($ikey, $ikey_ex) IF (@error <> 0) OR (len($result_data_type) = 0) $result_data_type="REG_SZ" ENDIF ELSE $result_data_type="REG_SZ" ENDIF IF (ReadValue($ikey, $ikey_ex) <> $default_key) IF (writevalue($ikey, $ikey_ex, $default_key, $result_data_type) = 0) IF (writevalue($ikey, $ikey_ex, $default_key, "REG_SZ") = 0) ENDIF ENDIF IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $info=$info+" "+$ikey+"="+$default_key ENDIF ENDIF ; -------------------------------------------------------------------------- ; - cleanup 'recent list' - ; -------------------------------------------------------------------------- $max_ikeys=31 REDIM $ikeys[$max_ikeys+1] $ikeys[01]="HKEY_CURRENT_USER\Software\Binary Research Ltd\Ghost Explorer\Recent File List" $ikeys[02]="HKEY_CURRENT_USER\Software\Microsoft\Frontpage\Explorer\Frontpage Explorer\Recent File List" $ikeys[03]="HKEY_CURRENT_USER\Software\Microsoft\Frontpage\Explorer\Frontpage Explorer\Recent Web List" $ikeys[04]="HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs" $ikeys[05]="HKEY_CURRENT_USER\Software\Microsoft\Microsoft Management Console\Recent File List" $ikeys[06]="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Excel\Recent File List" $ikeys[07]="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\MS Project\Recent File List" $ikeys[08]="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\PowerPoint\Recent File List" $ikeys[09]="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Publisher\Recent File List" $ikeys[10]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Recent File List" $ikeys[11]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\MS Project\Recent File List" $ikeys[12]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\PowerPoint\Recent File List" $ikeys[13]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Publisher\Recent File List" $ikeys[14]="HKEY_CURRENT_USER\Software\Microsoft\Outlook Express\Recent Stationery List" $ikeys[15]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" $ikeys[16]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\WordPad\Recent File List" $ikeys[17]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU" $ikeys[18]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" $ikeys[19]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\DesktopStreamMRU" $ikeys[20]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Doc Find Spec MRU" $ikeys[21]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FindComputerMRU" $ikeys[22]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PrnPortsMRU" $ikeys[23]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" $ikeys[24]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" $ikeys[25]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU" $ikeys[26]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\Preload" $ikeys[27]="HKEY_CURRENT_USER\Software\Netscape\Netscape Navigator\URL History" $ikeys[28]="HKEY_CURRENT_USER\Software\Nico Mak Computing\Winzip\extract" $ikeys[29]="HKEY_CURRENT_USER\Software\Nico Mak Computing\Winzip\filemenu" $ikeys[30]="HKEY_CURRENT_USER\InstallLocationsMRU" $ikeys[31]="HKEY_USERS\.Default\InstallLocationsMRU" ; $i=1 WHILE ($i <= $max_ikeys) $ikey=$ikeys[$i] $i=$i+1 IF (ExistKey($ikey) = 0) IF ($debug_mode = "yes") ? "input -> ["+$ikey+"]" ENDIF DO $icode=ENUMVALUE($ikey, 0) IF (len($icode) <> 0) $ivalue=ReadValue($ikey, $icode) $result=DelValue($ikey, $icode) IF ($debug_mode = "yes") IF ($result = 0) ? " "+$icode+"="+$ivalue ELSE ? " error "+$icode+"="+$ivalue+" -> "+$result ENDIF ENDIF ENDIF UNTIL (len($icode) = 0) ENDIF LOOP ; $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" IF (Exist($ikey) = 0) $info=$info+" user_shell_folders=(" ; $ivalue=ReadValue($ikey, "AppData") IF ($debug_mode = "yes") ? "recent.user_shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\Microsoft\Office\Recent\."+CHR(34) $info=$info+"-appdata" ENDIF ; $ivalue=ReadValue($ikey, "Cache") IF ($debug_mode = "yes") ? "recent.user_shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\."+CHR(34) $info=$info+"-cache" ENDIF ; $ivalue=ReadValue($ikey, "Cookies") IF ($debug_mode = "yes") ? "recent.user_shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\."+CHR(34) $info=$info+"-cookies" ENDIF ; $ivalue=ReadValue($ikey, "Local Settings") IF ($debug_mode = "yes") ? "recent.user_shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\History\."+CHR(34) $info=$info+"-local.history" ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\Temp\."+CHR(34) $info=$info+"-local.temp" ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\Temporary Internet Files\."+CHR(34) $info=$info+"-local.temporary_internet_files" ENDIF ; $ivalue=ReadValue($ikey, "Recent") IF ($debug_mode = "yes") ? "recent.user_shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) del ExpandEnvironmentVars($ivalue)+"\*.lnk" $info=$info+"-recent" ENDIF $info=$info+"-)" ENDIF ; $ikey="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" IF (Exist($ikey) = 0) $info=$info+" shell_folders=(" ; $ivalue=ReadValue($ikey, "AppData") IF ($debug_mode = "yes") ? "recent.shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\Microsoft\Office\Recent\."+CHR(34) $info=$info+"-appdata" ENDIF ; $ivalue=ReadValue($ikey, "Cache") IF ($debug_mode = "yes") ? "recent.shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\."+CHR(34) $info=$info+"-cache" ENDIF ; $ivalue=ReadValue($ikey, "Cookies") IF ($debug_mode = "yes") ? "recent.shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\."+CHR(34) $info=$info+"-cookies" ENDIF ; $ivalue=ReadValue($ikey, "Local Settings") IF ($debug_mode = "yes") ? "recent.shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\History\."+CHR(34) $info=$info+"-local.history" ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\Temp\."+CHR(34) $info=$info+"-local.temp" ENDIF IF (len($ivalue) <> 0) shell "%comspec% /e:1024 /c deltree /y "+CHR(34)+ExpandEnvironmentVars($ivalue)+"\Temporary Internet Files\."+CHR(34) $info=$info+"-local.temporary_internet_files" ENDIF ; $ivalue=ReadValue($ikey, "Recent") IF ($debug_mode = "yes") ? "recent.shell_folders -> "+$ivalue+"="+ExpandEnvironmentVars($ivalue) ENDIF IF (len($ivalue) <> 0) del ExpandEnvironmentVars($ivalue)+"\*.lnk" $info=$info+"-recent" ENDIF $info=$info+"-)" ENDIF ; del "c:\ffastun*.*" del "c:\file*.chk" del "c:\temp\~*.*" del "c:\temp\*.~*" del "c:\temp\*.??~" del "c:\temp\*.tmp" del "c:\temp\mscreate.dir" del "c:\temp\*.---" IF ($NT_mode = "yes") del "c:\winnt\~*.*" del "c:\winnt\*.~*" del "c:\winnt\*.??~" del "c:\winnt\*.tmp" del "c:\winnt\mscreate.dir" del "c:\winnt\*.---" del "c:\winnt\temp\~*.*" del "c:\winnt\temp\*.~*" del "c:\winnt\temp\*.??~" del "c:\winnt\temp\*.tmp" del "c:\winnt\temp\mscreate.dir" del "c:\winnt\temp\*.---" ELSE del "c:\windows\~*.*" del "c:\windows\*.~*" del "c:\windows\*.??~" del "c:\windows\*.tmp" del "c:\windows\mscreate.dir" del "c:\windows\*.---" del "c:\windows\temp\~*.*" del "c:\windows\temp\*.~*" del "c:\windows\temp\*.??~" del "c:\windows\temp\*.tmp" del "c:\windows\temp\mscreate.dir" del "c:\windows\temp\*.---" ENDIF ; $max_ikeys=9 REDIM $ikeys[$max_ikeys+1] REDIM $sub_ikeys[$max_ikeys+1] $ikeys [1]="HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\4.0\AdobeViewer" $sub_ikeys[1]="AVPrecentFile" ; $ikeys [2]="HKEY_CURRENT_USER\Software\Adobe\Adobe Acrobat\4.0\AdobeViewer" $sub_ikeys[2]="AVPrecentFile" ; $ikeys [3]="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Access\Settings" $sub_ikeys[3]="MRU" ; $ikeys [4]="HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Access\Settings" $sub_ikeys[4]="MRUFlags" ; $ikeys [5]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\Open Find\Microsoft Word\Settings\Save As\File Name MRU" $sub_ikeys[5]="Value" ; $ikeys [6]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Access\Settings" $sub_ikeys[6]="MRU" ; $ikeys [7]="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Access\Settings" $sub_ikeys[7]="MRUFlags" ; $ikeys [8]="HKEY_CURRENT_USER\Software\Microsoft\Photo Editor\3.0\Microsoft Photo Editor" $sub_ikeys[8]="LastFile" ; $ikeys [9]="HKEY_CURRENT_USER\Software\Microsoft\Photo Editor\3.0\Microsoft Photo Editor" $sub_ikeys[9]="LastType" ; ; $i=1 WHILE ($i <= $max_ikeys) $ikey=$ikeys[$i] $sub_ikey=$sub_ikeys[$i] IF (ExistKey($ikey) = 0) IF ($debug_mode = "yes") ? "input -> ["+$ikey+"]+["+$sub_ikey+"??]" ENDIF $k=0 WHILE ($k <= 10) $ivalue=ReadValue($ikey, $sub_ikey+$k) $result=DelValue($ikey, $sub_ikey+$k) IF ($debug_mode = "yes") IF ($result = 0) ? " "+$sub_ikey+$k+"="+$ivalue ELSE ; ? " error "+$sub_ikey+$k+"="+$ivalue+" -> "+$result ENDIF ENDIF $k=$k+1 LOOP ENDIF $i=$i+1 LOOP ; $max_ikeys=8 REDIM $ikeys [$max_ikeys+1] REDIM $file_ikeys[$max_ikeys+1] REDIM $sub_ikeys [$max_ikeys+1] REDIM $sub_values[$max_ikeys+1] $ikeys [1]="directories" $file_ikeys[1]="c:\windows\winzip32.ini" $sub_ikeys [1]="AddDir" $sub_values[1]="c:" $ikeys [2]="directories" $file_ikeys[2]="c:\windows\winzip32.ini" $sub_ikeys [2]="DefDir" $sub_values[2]="c:\temp" $ikeys [3]="directories" $file_ikeys[3]="c:\windows\winzip32.ini" $sub_ikeys [3]="ExtractTo" $sub_values[3]="c:\temp\" $ikeys [4]="directories" $file_ikeys[4]="c:\windows\winzip32.ini" $sub_ikeys [4]="ZipTemp" $sub_values[4]="c:\temp" $ikeys [5]="directories" $file_ikeys[5]="c:\winnt\winzip32.ini" $sub_ikeys [5]="AddDir" $sub_values[5]="c:" $ikeys [6]="directories" $file_ikeys[6]="c:\winnt\winzip32.ini" $sub_ikeys [6]="DefDir" $sub_values[6]="c:\temp" $ikeys [7]="directories" $file_ikeys[7]="c:\winnt\winzip32.ini" $sub_ikeys [7]="ExtractTo" $sub_values[7]="c:\temp\" $ikeys [8]="directories" $file_ikeys[8]="c:\winnt\winzip32.ini" $sub_ikeys [8]="ZipTemp" $sub_values[8]="c:\temp" ; $i=1 WHILE ($i <= $max_ikeys) $ikey=$ikeys[$i] $file_ikey=$file_ikeys[$i] $sub_ikey=$sub_ikeys[$i] $sub_value=$sub_values[$i] IF (Exist($file_ikey) = 1) IF ($debug_mode = "yes") ? "input -> "+$file_ikey+" ["+$ikey+"] "+$sub_ikey ENDIF $result=WriteProfileString($file_ikey, $ikey, $sub_ikey, $sub_value) IF ($debug_mode = "yes") IF ($result = 0) ? " "+$sub_ikey+"='"+$sub_value+"'" ELSE ? " error "+$sub_ikey+"='"+$sub_value+"' -> "+$result ENDIF ENDIF ENDIF $i=$i+1 LOOP ; $max_ikeys=7 REDIM $ikeys [$max_ikeys+1] REDIM $file_ikeys[$max_ikeys+1] REDIM $sub_ikeys [$max_ikeys+1] $ikeys [1]="scan paths" $file_ikeys[1]="c:\windows\fontsmrt.ini" $sub_ikeys [1]="Path" ; $ikeys [2]="scan paths" $file_ikeys[2]="c:\winnt\fontsmrt.ini" $sub_ikeys [2]="Path" ; $ikeys [3]="application" $file_ikeys[3]="c:\progra~1\visio\system\visio.ini" $sub_ikeys [3]="LastFile" ; $ikeys [4]="extract" $file_ikeys[4]="c:\windows\winzip32.ini" $sub_ikeys [4]="Extract" ; $ikeys [5]="extract" $file_ikeys[5]="c:\winnt\winzip32.ini" $sub_ikeys [5]="Extract" ; $ikeys [6]="filemenu" $file_ikeys[6]="c:\windows\winzip32.ini" $sub_ikeys [6]="filemenu" ; $ikeys [7]="filemenu" $file_ikeys[7]="c:\winnt\winzip32.ini" $sub_ikeys [7]="filemenu" ; ; $i=1 WHILE ($i <= $max_ikeys) $ikey=$ikeys[$i] $file_ikey=$file_ikeys[$i] $sub_ikey=$sub_ikeys[$i] IF (Exist($file_ikey) = 1) IF ($debug_mode = "yes") ? "input -> "+$file_ikey+" ["+$ikey+"] "+$sub_ikey+"??" ENDIF $k=0 WHILE ($k <= 15) $result=WriteProfileString($file_ikey, $ikey, $sub_ikey+$k, "") IF ($debug_mode = "yes") IF ($result = 0) ? " "+$sub_ikey+$k ELSE ? " error "+$sub_ikey+$k+" -> "+$result ENDIF ENDIF $k=$k+1 LOOP ENDIF $i=$i+1 LOOP $max_ikeys=3 REDIM $ikeys[$max_ikeys+1] $ikeys[1]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" $ikeys[2]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts" $ikeys[3]="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" ; $i=1 WHILE ($i <= $max_ikeys) $ikey=$ikeys[$i] IF (ExistKey($ikey) = 0) $completed="no" $first="" $info=$info+" HKCU.["+$i+"]=(" IF ($debug_mode = "yes") ? "input -> ["+$ikey+"]" ENDIF DO $icode=ENUMKEY($ikey, 0) ; - after deletion next entry becomes first entry - IF (@error = 0) IF (len($icode) <> 0) $ikey1=$ikey+"\"+$icode IF (ExistKey($ikey1) = 0) $result=DelTree($ikey1) IF (@error <> 0) ? "Warning "+$ikey1+": "+@serror ELSE $info=$info+$first+"'"+$icode+"'" $first="," ENDIF IF ($debug_mode = "yes") ? " "+$icode ENDIF ENDIF ENDIF ELSE $completed="yes" ENDIF UNTIL ($completed = "yes") $info=$info+")" ENDIF $i=$i+1 LOOP $info=$info+" cleanup.recent" ; -------------------------------------------------------------------------- shell "%comspec% /e:1024 /c deltree /y c:\recycled\." shell "%comspec% /e:1024 /c deltree /y c:\temp\." shell "%comspec% /e:1024 /c if not exist c:\recycled\nul mkdir c:\recycled" shell "%comspec% /e:1024 /c if not exist c:\temp\nul mkdir c:\temp" IF ($NT_mode = "yes") shell "%comspec% /e:1024 /c deltree /y c:\winnt\_delis32.ini" shell "%comspec% /e:1024 /c deltree /y c:\winnt\irfanv*.lst" shell "%comspec% /e:1024 /c deltree /y c:\winnt\history\." shell "%comspec% /e:1024 /c deltree /y c:\winnt\temp\." ELSE shell "%comspec% /e:1024 /c deltree /y c:\windows\_delis32.ini" shell "%comspec% /e:1024 /c deltree /y c:\windows\irfanv*.lst" shell "%comspec% /e:1024 /c deltree /y c:\windows\cookies\." shell "%comspec% /e:1024 /c deltree /y c:\windows\history\." shell "%comspec% /e:1024 /c deltree /y c:\windows\recent\." shell "%comspec% /e:1024 /c deltree /y c:\windows\temp\." shell "%comspec% /e:1024 /c deltree /y c:\windows\tempor~1\." ENDIF shell "%comspec% /e:1024 /c deltree /y c:\progra~1\timesink\adgate~1\ads\." :end_script $time_stop=@time IF ($NT_mode = "yes") $log_info="Kixtart-cleanup "+$prgrm_version+" script completed successfully" $log_info=$log_info+" ("+$time_start+" - "+$time_stop+")" $log_info=$log_info+" "+GetDiskSpace("c:")+" MBytes" $log_info=$log_info+" "+$info ; IF ($debug_mode = "yes") ? ? " logevent = "+$log_info ? ENDIF IF logevent(0, 1, $log_info, "", "Kixtart CLEAN @kix") ENDIF IF (exist("c:\log.com") = 1) shell "%comspec% /e:1024 /c c:\log.com -cleanup "+$os+"-" ENDIF ELSE IF ($debug_mode = "yes") ? $info ENDIF IF (exist("c:\log.com") = 1) shell "%comspec% /e:1024 /c c:\log.com -cleanup "+$os+"-" ENDIF ENDIF ; IF (RedirectOutput("CON") = 0) ENDIF IF ($debug_mode = "yes") ? "Informative Cleanup.KIX: create debug list '"+$debug_file+"'" ELSE ? "Informative Cleanup.KIX: no creation of debug list '"+$debug_file+"'" ENDIF break on flushkb :end