这是我的HTA中包含vbs的一部分。它浏览目录树并获取文件夹。然后文件夹路径将在文本框submitted
中,然后通过单击HTA中的按钮删除该文件夹。但它继续向我显示错误@最后一行fso.DeleteFolder(PickFolder_Delete)
我不知道如何将值从delete
function
Sub ChooseCancelFolder_OnClick()
strStartDir = "\\fs-02\Data\"
Submitted.txtFile.value = PickFolder_Delete(strStartDir)
End Sub
Function PickFolder_Delete(strStartDir)
Dim SA, F
Set SA = CreateObject("Shell.Application")
Set F = SA.BrowseForFolder(0, "Choose a folder", 0, strStartDir)
If (Not F Is Nothing) Then
PickFolder_Delete = F.Items.Item.path
End If
Set F = Nothing
Set SA = Nothing
End Function
Sub DeleteAFolder_OnClick()
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(PickFolder_Delete)
End Sub