使用 Run Program() 执行 .bat 文件我正在尝试从 JSL 执行 .bat 文件,但它无法按预期工作。
我缺少什么?
https://www.jmp.com/support/help/en/15.1/#page/jmp/run-external-programs.shtml
rp = RunProgram( Executable( "cmd.exe" ),
Options( {"C:\temp\myfile.bat"} ),
ReadFunction("text") // returns all text
);
//"Microsoft Windows [Version xxx]
//(c) 2018 Microsoft Corporation. All rights reserved.
//
// C:\Program Files\SAS\JMPPRO\15>"自动化和脚本编写消费者和市场研究数据混合和清理实验设计质量和工艺工程分享和交流结果回复:使用 Run Program() 执行 .bat 文件我发现一个网站解释了为什么引号如此困难。
https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/mp/245968/highlight/true#M48328
回复:使用 Run Program() 执行 .bat 文件我们可以使用 cmd /c 在 MS-DOS 或 cmd.exe 中运行命令。 我们还将添加我们想要运行的命令字符串。 例如,如果我们想运行 ping poftut.com,我们将发出以下命令。 该命令将创建一个进程,该进程将运行命令,然后在命令执行完成后终止。 使用 ” 双引号包围命令也非常有用。
--> cmd /c "ping poftut.com"回复:使用 Run Program() 执行 .bat 文件您缺少 1 个参数
rp = RunProgram( Executable( "cmd.exe" ),
Options( {"/C", "C:\temp\myfile.bat"} ),
ReadFunction("text") // returns all text
);