博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vbs 实现压缩文件夹为zip文件
阅读量:4213 次
发布时间:2019-05-26

本文共 648 字,大约阅读时间需要 2 分钟。

代码如下:


' VB Script Document

option explicit


createZip "
d:\test", "d:\testZip.zip"


sub createZip(sfolder, tfolder)

 
 dim fso, zipfile

 
 dim 
shell, WshShell, destfolder, srcfolder

 

 
 ' create a blank zip compress file

 
 set fso = CreateObject("Scripting.FileSystemObject")

 
 set zipfile = fso.OpenTextFile(tfolder, 8, vbtrue)

 

 
 zipfile.Write "PK" & Chr(5) & Chr(6) & string(18, 0)

 
 zipfile.close

 

 
 ' copy you file into blank zip file

 
 set shell = CreateObject("Shell.Application")

 
 set WshShell = WScript.CreateObject("WScript.Shell")

 

 
 set destfolder = shell.NameSpace(tfolder)

 
 set srcfolder = shell.NameSpace(sfolder)

 

 
 destfolder.CopyHere srcfolder.items, &H214


end sub

转载地址:http://aafmi.baihongyu.com/

你可能感兴趣的文章
test-definitions/blob/master/auto-test/docker/docker.sh
查看>>
test-definitions/blob/master/auto-test/dsdbench/dsdbench.sh
查看>>
test-definitions/blob/master/auto-test/dsdbench/dsdbench.sh
查看>>
test-definitions/blob/master/auto-test/dstat/dstat.sh
查看>>
test-definitions/blob/master/auto-test/etcd/etcd.sh
查看>>
test-definitions/blob/master/auto-test/ftp/ftp.sh
查看>>
test-definitions/blob/master/auto-test/gprof/gprof.sh
查看>>
test-definitions/blob/master/auto-test/hhvm/hhvm.sh
查看>>
test-definitions/blob/master/auto-test/httperf-client/httperf.sh
查看>>
test-definitions/blob/master/auto-test/iostat/iostat.sh
查看>>
test-definitions/blob/master/auto-test/kernel-compilation/kernel-compilation.sh
查看>>
内核ACPI函数API之acpi_platform_fill_resource
查看>>
内核ACPI函数API之acpi_create_platform_device
查看>>
ceph网络通信架构
查看>>
内核ACPI函数API之acpi_scan_add_handler
查看>>
内核ACPI函数API之acpi_bind_one和acpi_unbind_one
查看>>
bios 为硬盘中的grub生成入口
查看>>
kernel解析SRAT 表的个数限制是NR_NODE_MEMBLKS
查看>>
内核ACPI函数API之acpi_execute_simple_method
查看>>
内核ACPI函数API之acpi_bus_get_status
查看>>