/* Date: 03/10/2003 Programmer: Rich@AutoTraker.com www.autotraker.com Description: Fix Windows XP to search for a string within dBase programs Windows XP's search has a new feature. It restricts searching for a string in a file based on a set list of file types. If you want to search for a string within dBase program files such as WFM, PRG etc. you can't do it. This program modifies your registry to allow XP's search to search for strings within dBase programs More information about this problem is available at: http://support.microsoft.com/default.aspx?scid=KB;EN-US;309173 Usage: Just run it. Dependencies: Windows Scripting Host Download latest version 5.6 at: http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/733/msdncompositedoc.xml */ #define REG_SZ 1 // Unicode nul terminated string #define REG_DWORD 4 // 32-bit number P = "HKEY_CLASSES_ROOT\." P1 = "\PersistentHandler\" N = "{5e941d80-bf96-11cd-b579-08002b30bfeb}" WshShell = new OleAutoClient("WScript.Shell") // Yes, No, Cancel messagebox result = msgbox("Do you want to just add dBase file types to XP's search"+chr(13)+; "or allow XP to search ALL files reguardless of the file type?"+chr(13)+chr(13)+; "Yes for just dBase file types, No for all file types, or cancel"+chr(13)+; "if you don't want to do anything."+chr(13)+; "Keep in mind that if you cloose No for all file types, when you"+chr(13)+; "search for a string, XP will search all files and it may be rather slow.","Select!",35) if result = 6 // all dBase file types aFileType = new array() aFileType.add("prg") aFileType.add("wfm") aFileType.add("dmd") aFileType.add("cc") aFileType.add("sql") aFileType.add("mnu") aFileType.add("pop") aFileType.add("h") aFileType.add("prj") aFileType.add("cfm") aFileType.add("rep") aFileType.add("crp") aFileType.add("lab") aFileType.add("cdm") aFileType.add("bat") aFileType.add("txt") aFileType.add("log") aFileType.add("ini") ok = "" different = "" updated = "" for i = 1 to aFileType.size fileType = aFileType[i] X = "" RegKey = P + fileType + P1 try // if key doesn't exist, you get an error X = WshShell.RegRead(RegKey) catch(exception e) endtry if X = N ok += fileType + " " elseif X <> N and X <> "" different += filetype + " " elseif empty(X) WshShell.RegWrite(RegKey,N) updated += fileType + " " endif endfor str = iif(empty(ok),"",'Handler exists and is OK for "'+ok+'"'+chr(13)) str += iif(empty(different),"",'Handler exists and is different for "'+different+'"'+chr(13)) str += iif(empty(updated),"",'Handler does not exist, Setting Handler for "'+updated+'"') msgbox(str,"Info!",32) elseif result = 7 // this parameter should set everything to be searched RegKey = "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet\Control\ContentIndex\" RegKey += "FilterFilesWithUnknownExtensions" ON = 0x00000001 try WshShell.RegWrite(RegKey,ON,"REG_DWORD") msgbox("Handler will now search ALL file types","Info!",32) catch(exception e) msgbox(e.message,"Error!",16) endtry endif release object WshShell WshShell = null return