cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
FN
FN
Level VI

Executing .bat files using Run Program()

I am trying to execute a .bat file from JSL but it does not work as expected.

 

What am I missing? 

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>"
2 ACCEPTED SOLUTIONS

Accepted Solutions
ThuongLe
Level IV

Re: Executing .bat files using Run Program()

You're missing 1 parameter

rp = RunProgram( Executable( "cmd.exe" ),
	Options( {"/C", "C:\temp\myfile.bat"} ),
	ReadFunction("text") // returns all text	
);
Thuong Le

View solution in original post

ThuongLe
Level IV

Re: Executing .bat files using Run Program()

We can run commands in MS-DOS or in cmd.exe by using cmd /c. We will also add the command string we want to run. For example, if we want to run ping poftut.com we will issue the following command. The command will create a process that will run command and then terminate after the command execution is completed. Also using ” double quotes in order to surround command are very useful.

--> cmd /c "ping poftut.com"
Thuong Le

View solution in original post

3 REPLIES 3
ThuongLe
Level IV

Re: Executing .bat files using Run Program()

You're missing 1 parameter

rp = RunProgram( Executable( "cmd.exe" ),
	Options( {"/C", "C:\temp\myfile.bat"} ),
	ReadFunction("text") // returns all text	
);
Thuong Le
ThuongLe
Level IV

Re: Executing .bat files using Run Program()

We can run commands in MS-DOS or in cmd.exe by using cmd /c. We will also add the command string we want to run. For example, if we want to run ping poftut.com we will issue the following command. The command will create a process that will run command and then terminate after the command execution is completed. Also using ” double quotes in order to surround command are very useful.

--> cmd /c "ping poftut.com"
Thuong Le
Craige_Hales
Super User

Re: Executing .bat files using Run Program()

I found a site that explained why the quotation marks are so hard.

https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using... 

Craige

Recommended Articles