gpt4 book ai didi

vbscript - VB 脚本 : Message while Unzipping a file

转载 作者:行者123 更新时间:2023-12-04 04:48:37 24 4
gpt4 key购买 nike

我正在使用下面的 vb 脚本来解压缩文件,所以在解压缩过程中,我看到一个弹出消息(复制/提取),有什么办法可以摆脱弹出消息?

FileToGetUnZipped = "InstallDir\UI_Files.zip"
DestPathForUnzippedFile = "InstallDir\system"

Set objFSO = CreateObject("Scripting.FileSystemObject")

If Not objFSO.FolderExists(DestPathForUnzippedFile) Then
objFSO.CreateFolder(DestPathForUnzippedFile)
End If

UnZipFile FileToGetUnZipped, DestPathForUnzippedFile

Sub UnZipFile(strArchive, DestPathForUnzippedFile)
Set objApp = CreateObject( "Shell.Application" )

Set objArchive = objApp.NameSpace(strArchive).Items()
Set objDest = objApp.NameSpace(DestPathForUnzippedFile)

objDest.CopyHere objArchive
End Sub

最佳答案

CopyHere方法采用第二个参数,它可以是各种选项的组合,包括

(4)

Do not display a progress dialog box.



但是,我在让许多这些选项可靠地工作方面并没有取得太大的成功 - 我认为它因 Windows 版本而异,就像其他任何东西一样。

作为旁注,我认为您可能对 CopyHere 有问题。方法是异步的 - 您的脚本可能会在 CopyHere 之前完成确实如此,这可能会终止复制过程。

关于vbscript - VB 脚本 : Message while Unzipping a file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17787677/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com