使用CFExecute运行VBScript会引发错误,但可以通过命令行正常运行 [英] Run VBScript using CFExecute throws error but works fine via command line

查看:129
本文介绍了使用CFExecute运行VBScript会引发错误,但可以通过命令行正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行VBScript,但是CFExecute抛出错误

I am trying to run a VBScript but CFExecute throws an error

<cfexecute name = "C:\Windows\System32\CScript.exe" 
            arguments = "//NoLogo D:\Excel.vbs D:\test.xls"
            variable = "data"
            timeout = "100">
 </cfexecute>
<cfdump var="#data#">

错误:

 Error: 424 Source: Microsoft VBScript runtime error Description: Object required 

但是当我使用CMD运行VBScript时,效果很好

But when I run the VBScript with CMD it works fine

C:\Windows\System32 > cscript //nologo D:\Excel.vbs D:\test.xls

我具有完整的管理员访问权限,为什么我会收到此错误?

I have full admin access, so why am I getting this error?

推荐答案

它是

It was due to bug in the Windows 2008 server. For office automation (accessing via script and non-window based operation) we have to add a "Desktop" folder inside

C:\Windows\System32\config\systemprofile
C:\Windows\SysWOW64\config\system32

我添加了它,并找到了成功.

I added it and found success.

这篇关于使用CFExecute运行VBScript会引发错误,但可以通过命令行正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆