我写信是为了从 Silk bdh 调用 VBScript 并从 Silk 传递参数。我的第一个问题是有多个参数(总共 4 个参数)。我的第二个问题是这些参数包含空格。
下面是程序:
sCmdLine := "cscript.exe";
//sParms := "C:\\QK\\test1_old.vbs \" \"" +string(error_counter)+"\" \"" +error_timer ;
sParms := "C:\\QK\\test1.vbs \" 2\string(error_counter)+
error_timer+error_details+error_time;
hProcessId := ProcessInitialize(sCmdLine, PROCESS_PIPED, sParms,"C:\\WINDOWS\\System32\\");
ProcessSetOutputBuffer(hProcessId, reportedTo, STRING_COMPLETE);
ProcessStart(hProcessId);
StrSearchDelimited(reportedTo,STRING_COMPLETE,reportedTo,"reserved.",1,NULL,1,STR_SEARCH_FIRST);
print("reportedTo*****"+reportedTo);
VBS程序是:
dim captcha
errorcounter=Wscript.Arguments(0)
errortimer=Wscript.Arguments(1)
errordetails=Wscript.Arguments(2)
errortime=Wscript.Arguments(3)
text= "Level : " & errorcounter
text= text & vbNewline
text = text & "Page : " & errortimer
text= text & vbNewline
text = text & "Error : " & errordetails
text= text & vbNewline
text = text & "Error Time : " & errortime
reportedto=inputbox( text,"ReportedTo")