appname = "OE.exe" key = "HKCU\Software\MetaProducts\Offline Explorer MX\Parameters\CurrentDir" set wshshell = createobject("wscript.shell") ProgramFilesPath = wshshell.expandenvironmentstrings("%ProgramFiles%") wshshell.run """" & ProgramFilesPath & "\Offline Explorer Enterprise\OE.exe" & """" & " /exit", , true pathDir = ReadPath(key) fileWD = pathDir & "\WebDown.dat" DelObjects fileWD, pathDir wshshell.run """" & ProgramFilesPath & "\Offline Explorer Enterprise\OE.exe" & """" wscript.quit sub DelObjects(fname, path) set fso = createobject("scripting.filesystemobject") set txtfile = fso.opentextfile(fname) txt = txtfile.readall txtfile.close if not fso.folderexists(path & "\Temp") then fso.createfolder path & "\Temp" set shapp = createobject("shell.application") shapp.namespace(path & "\Temp").movehere fname, 16 arr = split(txt,"[Object]") arrdesc = filter(arr,"Descr=") str = left(arr(0),instr(arr(0),"ObjectsCount=")+12) & cstr(ubound(arrdesc)+1) & vbcrlf set txtfile = fso.opentextfile(fname, 2, true) txtfile.write str & "[Object]" & join(arrdesc,"[Object]") txtfile.close end sub function ReadPath(key) set wshshell = createobject("wscript.shell") ReadPath = wshshell.regread(key) end function |