2

这与我启动的上一个线程有关,但它处理的是一种实际有效的方法。

我创建了一个由 ColdFusion 执行的 VBScript,并将传真发送到特定号码。以下是我编写的 VBScript,取自 Microsoft TechNet 站点:

Set objFaxDocument = WScript.CreateObject("FAXCOMEX.FaxDocument")
Set objFaxServer = WScript.CreateObject("FAXCOMEX.FaxServer")
Dim JobID

objFaxServer.Connect("")
objFaxDocument.Body = "C:\*PATHNAME*\testfax.pdf"
objFaxDocument.DocumentName = "My First Fax"
objFaxDocument.Priority = "2"

objFaxDocument.Recipients.Add("8885551212")

objFaxDocument.AttachFaxToReceipt = True

objFaxDocument.CoverPageType = "1"
objFaxDocument.CoverPage = "generic"
objFaxDocument.Note = "Here is the info you requested"
objFaxDocument.ReceiptAddress = "test@test.com"

objFaxDocument.Subject = "Today's fax"
objFaxDocument.Sender.Title = "Mr."
objFaxDocument.Sender.Name = "Test Man"
objFaxDocument.Sender.City = "Test City"
objFaxDocument.Sender.State = "FL"
objFaxDocument.Sender.Company = "Test Company"
objFaxDocument.Sender.Country = "USA"
objFaxDocument.Sender.Email = "test@test.com"
JobID = objFaxDocument.ConnectedSubmit(objFaxServer)
MsgBox("The Job ID is :" & JobID(0))

objFaxServer.Disconnect()

以下是我用来执行这个 vbscript 的 ColdFusion 代码:

<cfexecute name="C:\Windows\System32\cscript.exe"
    arguments="C:\*SCRIPTPATH*\test.vbs">
</cfexecute>

在装有 Windows Server 2003 的机器上,这成功地将文档发送到 Windows 传真服务应用程序,并将传真正确存储在发件箱中。但是,当我在 Windows Server 2008 上尝试此操作时,它不起作用。需要注意的是,虽然使用的是相同版本的 ColdFusion (8),但 2008 机器是 64 位的,而 2003 是 32 位的。

这可能已经在其他地方得到了回答(如果是这样,请指导我),但我在这方面度过了最艰难的时期,并且没有多少成功的解决方案可供我找到。我知道我错过了一些东西,但我不知道是什么。有人可以帮忙吗?

4

1 回答 1

0

This is difficult to answer that precisely because you don't quantify "does not work". In what way does it not work? Is there an error on the screen? Is there an error in the log files anywhere? Does the VBS get called, but does it then fail (it could be a vagary of how it's being called)?

That said, I suspect it's a case that the service account that CF is running under doesn't have permissions to access or execute the VBS, or some other resource the VBS uses.

If you login as the user CF uses, can you execute that statement from a command line?

于 2012-06-29T07:08:32.603 回答