vbs实现压缩文件夹的脚本
程序员文章站
2022-07-04 20:42:19
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
下一篇: 陕甘总督和浙江巡抚是什么官职?有什么职责