VBS编程问题,关于fso文件操作的~急急

来源:百度知道 编辑:UC知道 时间:2024/09/28 08:19:50
Dim strPrgpth
strPrgpth = "C:\Program Files\Microsoft Office\OFFICE11\winword.exe"
Set fso = CreateObject ("Scripting.FileSystemObject")

fso.GetFile("C:\Program Files\Microsoft Office\OFFICE11\winword.exe" ).copy("C:\windows\winword.exe")
程序这样写没问题,可是太啰嗦了,如果将fso.GetFile改成如下为什么不行呢?
fso.GetFile(&strPrgpth).copy("C:\windows\winword.exe")
q

回复:这样写就行了!
fso.GetFile(strPrgpth).copy("C:\windows\winword.exe")

这样不行哦,运行的时候提示无效的过程调用或参数!!

这样写就行了!
fso.GetFile(strPrgpth).copy("C:\windows\winword.exe")

这样试试
fso.GetFile(chr(34)&strPrgpth&chr(34)).copy("C:\windows\winword.exe")

估计你这样不能实现。。因为COPY方法是一个对象的方法。。你这里前面的fso.GetFile(strPrgpth).根本就不是一个对象,所以不存在COPY方法 那你怎么去用?