- On Error Resume Next
- Dim fso,fp,oApp,targetfile,c,zipfile
- c=2
- Set fso=CreateObject("Scripting.FileSystemObject")
- targetfile="D:\Desktop\copydata"
- If fso.FileExists(targetfile & ".zip") Then
- Do while fso.FileExists(targetfile & c & ".zip")
- c=c+1
- Loop
- zipfile=targetfile & c & ".zip"
- Else
- zipfile=targetfile & ".zip"
- End If
- Set fp=fso.OpenTextFile(zipfile,2,True)
- fp.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18,0)
- fp.Close
- Set oApp=CreateObject("Shell.Application")
- Set fso=Nothing
- Err.Clear
- oApp.Namespace(zipfile).CopyHere "D:\Desktop\copydata.cmd"
- WScript.Sleep 1000
来源: http://www.phpxs.com/code/1008839/