标题: qtp中用vbscript脚本为何没有新的文件夹生成? [打印本页] 作者: lily_mu75 时间: 2006-12-29 13:03 标题: qtp中用vbscript脚本为何没有新的文件夹生成? 我在qtp中写了如下代码:
Sub AddNewFolder(path, folderName)
Dim fso, f, fc, nf
set path="C:\huangpl\huangpl_sub1\huangpl_sub2"
set folderName=sub203
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(path)
Set fc = f.SubFolders
If folderName <> "" Then
Set nf = fc.Add(folderName)
Else
Set nf = fc.Add("New Folder")
End If
End Sub
结果在目录C:\huangpl\huangpl_sub1\huangpl_sub2下并没有生成素白sub203文件夹
请教高手我写的程序哪里有问题?
[ 本帖最后由 lily_mu75 于 2006-12-29 13:35 编辑 ]作者: 风过无息 时间: 2006-12-29 13:35
Sub AddNewFolder(path, folderName)
Dim fso, f, fc, nf
' set path="C:\temp"
'set folderName=sub203
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(path)
Set fc = f.SubFolders
If folderName <> "" Then
Set nf = fc.Add(folderName)
Else
Set nf = fc.Add("New Folder")
End If
End Sub
Call AddNewFolder("C:\temp","folder name")