我有一个 HTA,它可以将一组文件复制到 USB 记忆棒中,作为创建 USB 实用程序磁盘的一部分。它可以正常工作,但问题是 HTA 在复制过程运行时变得无响应。
Const FOF_CREATEPROGRESSDLG = &H0&
sub CopyFiles(driveletter) ' Copys Files to the new USB Disk showing progress bar
if radio(0).checked Then
Set objFilesys = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
driveletter = ((driveletter) & "\")
Set objFolder = objshell.NameSpace(driveletter)
pathstring = objFilesys.GetAbsolutePathName("c:")
objFolder.CopyHere pathstring & "\" & "*.*", FOF_CREATEPROGRESSDLG
exit sub
elseif radio(1).checked Then
Set objFilesys = CreateObject("Scripting.FileSystemObject")
set objShell = CreateObject("shell.application")
pathstring = userselections.txtFile.value
if objFilesys.fileExists(pathstring & "\" & "kernel.sys") then
driveletter = ((driveletter) & "\")
Set objFolder = objshell.NameSpace(driveletter)
objFolder.CopyHere pathstring & "\" & "*.*", FOF_CREATEPROGRESSDLG
Else
msgbox "Error! The Specified path does not contain valid Install Files", vbcritical
end if
end if
end sub