vbs实现压缩文件夹的脚本
程序员文章站
2022-04-29 09:13:32
strcomputer = "." set objwmiservice = getobject("winmgmts:"&n...
strcomputer = "."
set objwmiservice = getobject("winmgmts:" _
& "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2")
set colfolders = objwmiservice.execquery _
("select * from win32_directory where ")
for each objfolder in colfolders
errresults = objfolder.compress
wscript.echo errresults
next
set objwmiservice = getobject("winmgmts:" _
& "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2")
set colfolders = objwmiservice.execquery _
("select * from win32_directory where ")
for each objfolder in colfolders
errresults = objfolder.compress
wscript.echo errresults
next
上一篇: 一个实现VBS倒计时的代码