'create the foloder
Sub AddNewFolder(path, folderName)
Dim fso, f, fc, nf,msg,fso1
Set fso = CreateObject("scrīpting.FileSystemObject")
Set f = fso.GetFolder(path)
Set fso1= CreateObject("scrīpting.FileSystemObject")
Set fc=f.SubFolders
If not (fso1.FolderExists(path&folderName)) Then
'msgbox "exists "
' Else
msg= MsgBox ("create the folder?", 4, "not find the test folder!")
If msg=6 Then '6yes,7no
Set nf = fc.Add(folderName)
End If
' Else
' Set nf = fc.Add("New Folder")
'End If
End If
end sub
调用函数
Dim te,te1
ExecuteFile "C:\Program Files\Mercury Interactive\QuickTest Plus\scrīptsAndTests\CreateFolder.vbs"
te="e:\"
te1="test"
Call AddNewFolder(te,te1)