call createTxtfileWithSeq()
call zipFile("D:\TestData\MPCI\80\vbs")
Function createTxtfileWithSeq()
set fso=createobject("Scripting.filesystemobject")
for i=0 to 3
for j=0 to 9
if i=0 and j=0 then
j=j+1
end if
if i=3 and j=2 then
exit for
exit for
end if
set myfile=fso.createtextfile("D:\TestData\MPCI\80\vbs\ycap_ls_201303"&i&j&".txt",True)
next
next
myfile.close
end function
Function zipFile(path)
dim objfolder
dim folderpath
dim folderinfo
folderpath=path
set objfolder=createobject("scripting.filesystemobject")
set folderinfo=objfolder.getfolder(folderpath)
set ffiles=folderinfo.files
for each f1 in ffiles
set oExec = createobject("wscript.shell").exec("7z a -tgzip "&folderpath&"\"&f1.name&".gz "&folderpath&"\"&f1.name)
'msgbox folderpath&"\"&f1.name
next
end function
create Txt and zip
最新推荐文章于 2024-05-07 18:33:07 发布