51Testing软件测试论坛
标题:
QTP中映射驱动器和拷贝文件夹的脚本
[打印本页]
作者:
tomtang
时间:
2007-12-19 13:33
标题:
QTP中映射驱动器和拷贝文件夹的脚本
QTP中映射驱动器和拷贝文件夹的脚本
映射驱动器:
Set WshNetwork = CreateObject("Wscrīpt.Network")
WshNetwork.MapNetworkDrive "z:","\\10.0.0.208\1","1","1"
删除驱动器:
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.RemoveNetworkDrive "Z:", "true","true"
拷贝文件夹:
Const ōverWriteFiles = True
Set ōbjFSO = CreateObject("scrīpting.FileSystemObject")
objFSO.CopyFolder "C:\pcnet" , "Z:\" ,OverWriteFiles
删除文件夹
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("Z:\pcnet")
[
本帖最后由 tomtang 于 2008-5-14 16:52 编辑
]
作者:
jinsen
时间:
2007-12-19 14:10
又多学了一招,谢谢LZ了。
'取消映射驱动器:
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.RemoveNetworkDrive "Z:"
作者:
jinsen
时间:
2007-12-19 14:27
有一个问题想问一下:
Dim WshNetwork
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.MapNetworkDrive "Z:","\\192.160.11.166\tmp\test", "test", "test"
我映射的是一台linux服务器,在运行后出现了"种类不一致"这个错误,请问有什么办法解决吗?
[
本帖最后由 jinsen 于 2007-12-19 15:51 编辑
]
作者:
jinsen
时间:
2007-12-19 15:51
顶一下,也请大家一起帮忙看看。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2