附带实例 <%'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\'\1.c:windows\system32\cmd.exe'\拷贝把本文件所在的路径'\'\2.把c:program\winrar\rar.exe'\拷贝把本文件所在的路径并改名为WinRAR.exe'\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\'\compressPath(byVals)'\压缩文件的路径|字符串变体'\'\decompressPath(byVals)'\解压缩文件的文件夹|字符串变体'\'\compress'\在线压缩'\'\decompress'\在线解压缩'\'\POWERBYMIRACLE(BLUEDESTINY)'\'\EMAIL:Bluedestiny[at]126.com'\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\OPTIONEXPLICITclassCOMPRESS_DECOMPRESS_FILESprivateversion,copyrightprivateoWshShell,oFsoprivatesCompressPath,sDecompressPathprivatesubclass_initializeversion="COMPRESS_DECOMPRESS_FILESBUILDER20051015"copyright="POWERBYMIRACLE(BLUEDESTINY)"SetoFso=server.CreateObject("scripting.FileSystemObject")SetoWshShell=server.CreateObject("Wscript.Shell")writeLn(version+"<br>"+copyright)endSubprivatesubclass_terminateifisobject(oWshShell)thensetoWshShell=nothingifisobject(oFso)thensetoFso=nothingendSubprivatefunctionphysicalPath(byVals)physicalPath=server.mappath(s)endFunctionprivatesubvalidateFile(byVals)ifoFso.FileExists(s)thenexitsubifoFso.FolderExists(s)thenexitsubcallErr"file(folder)notexists!"endSubprivatesubcreateFolder(byVals)ifoFso.FolderExists(s)thenexitSuboFso.createFolder(s)endSubprivatesubwriteLn(byVals)response.write"<p>"+s+"</p>"+vbCrlfendSubprivatesubcallErr(byVals)writeLn"<p><b>ERROR:</b></p>"+sresponse.EndendsubprivatesubcallSucc(byVals)writeLn"<p><b>SUCCESS:</b></p>"+sendSubpublicsubcompressvalidateFile(sCompressPath)oWshShell.run("WinRARA"+sCompressPath+""+sDecompressPath&"")ifErr.number>0thencallErr("compresslost!")callSucc("compress<b>"+sDecompressPath+"</b>to<b>"+sCompressPath+".rar</b>successfully!")endSubpublicsubdecompressvalidateFile(sCompressPath)createFolder(sDecompressPath)oWshShell.run("WinRARX"+sCompressPath+""+sDecompressPath&"")ifErr.number>0thencallErr("decompresslost!")callSucc("decompress<b>"+sCompressPath+".rar</b>to<b>"+sDecompressPath+"</b>successfully!")endsubpublicpropertyLetcompressPath(byVals)sCompressPath=physicalPath(s)endpropertypublicpropertyLetdecompressPath(byVals)sDecompressPath=physicalPath(s)endpropertyEndclass%><!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN"><HTML><HEAD><TITLE>NewDocument</TITLE><METANAME="Generator"CONTENT="EditPlus"><METANAME="Author"CONTENT=""><METANAME="Keywords"CONTENT=""><METANAME="Description"CONTENT=""><style>*{font-size:10.2pt;font-family:tahoma;}</style></HEAD><BODY><%'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\'\设有压缩文件compress.rar'\需压缩文件decompressFolder文件夹'\'\将compress.rar解压缩至1文件夹'\将decompressFolder文件夹压缩至2.rar'\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\dimoExamplesetoExample=newCOMPRESS_DECOMPRESS_FILESoExample.compressPath="decompressFolder"oExample.decompresspath="1"oExample.compressoExample.compressPath="compress.rar"oExample.decompresspath="2"oExample.decompresssetoExample=nothing%></BODY></HTML>