用户登录
用户注册

分享至

VBScript文件版本压缩管理

  • 作者: 霸气大丈夫
  • 来源: 51数据库
  • 2022-08-17
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
软件
前端设计
程序设计
Java相关