Batch file 从批处理文件(或计划任务)运行Ostendo脚本
我用Ostendo写了一个脚本,可以发送电子邮件。当从Ostendo中运行脚本时,这种方法效果很好。但当我尝试从批处理文件运行脚本时,它不起作用: 奥斯坦多脚本:Batch file 从批处理文件(或计划任务)运行Ostendo脚本,batch-file,pascal,Batch File,Pascal,我用Ostendo写了一个脚本,可以发送电子邮件。当从Ostendo中运行脚本时,这种方法效果很好。但当我尝试从批处理文件运行脚本时,它不起作用: 奥斯坦多脚本: Const TheEmailHostName = 'intmail.company.com'; TheEmailSenderAddress = 'simon.k@company.com'; TheUserEmail= 'Email Message Test'; TheRecipientsEmail = 'simon.k@company
Const
TheEmailHostName = 'intmail.company.com';
TheEmailSenderAddress = 'simon.k@company.com';
TheUserEmail= 'Email Message Test';
TheRecipientsEmail = 'simon.k@company.com';
Var
TheEmailSubject, TheEmailBody: String;
Begin
TheEmailSubject := 'In stock quantity of Item code CUSTOMPURCHASE does not equal zero';
TheEmailBody := 'Please correct this so the quantity equals zero. Please refer to the SOP which can be found in ...';
SendEmailMessage(TheEmailHostName,TheEmailSenderAddress,TheRecipientsEmail,TheEmailSubject,TheEmailBody);
//Showmessage('There are ' + QueryResult + ' in stock of CUSTOMPURCHASE')
End
批处理文件是:
Z:\ostendo.exe STARTUPID:Demo Script=SK - Test Email
“Demo”是Ostendo数据库的名称;
“SK-测试电子邮件”是Ostendo中脚本的名称
没有出现错误。它只是不发送电子邮件。在桌面或网络上它无法工作。Ostendo环境变量和/或工作目录可能会导致脚本名称中的空格导致问题。它们被解释为三个或四个独立的值,而不是一个。您可以尝试使用双引号(
Script=“SK-Test-Email”
)将其包围,或者将脚本重命名为不带空格的内容(Script=SKTestEMail
)。这就是问题所在(空格)。所以删除了空格。没有尝试双引号。谢谢