<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using RunProgram to start cmd.exe and execute commands in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63700#M34084</link>
    <description>&lt;P&gt;I want to use RunProgram to run an executable like notepad.exe through cmd.exe.&lt;/P&gt;&lt;P&gt;The below will return the correct directory but when I add another command to the options list "notepad.exe" I get an error that the system cannot find the path specified.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cmd1 = "/k cd /d " || "C:\Windows\System32";
RP = RunProgram(
	Executable( "CMD.EXE"),
	Options( {cmd1} ),	
	ReadFunction("text")
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have also seen this error a few times and don't fully understand what it is saying. How can this be remedied?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;The external program was producing output when the RunProgram object was destroyed.
Use a JSL variable to hold the RunProgram object.
Optionally, send messages to the variable to manage the object's lifetime.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 23 Jul 2018 21:12:00 GMT</pubDate>
    <dc:creator>MarcB</dc:creator>
    <dc:date>2018-07-23T21:12:00Z</dc:date>
    <item>
      <title>Using RunProgram to start cmd.exe and execute commands</title>
      <link>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63700#M34084</link>
      <description>&lt;P&gt;I want to use RunProgram to run an executable like notepad.exe through cmd.exe.&lt;/P&gt;&lt;P&gt;The below will return the correct directory but when I add another command to the options list "notepad.exe" I get an error that the system cannot find the path specified.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cmd1 = "/k cd /d " || "C:\Windows\System32";
RP = RunProgram(
	Executable( "CMD.EXE"),
	Options( {cmd1} ),	
	ReadFunction("text")
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have also seen this error a few times and don't fully understand what it is saying. How can this be remedied?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;The external program was producing output when the RunProgram object was destroyed.
Use a JSL variable to hold the RunProgram object.
Optionally, send messages to the variable to manage the object's lifetime.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Jul 2018 21:12:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63700#M34084</guid>
      <dc:creator>MarcB</dc:creator>
      <dc:date>2018-07-23T21:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using RunProgram to start cmd.exe and execute commands</title>
      <link>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63720#M34093</link>
      <description>&lt;P&gt;You should look at example 3 in the Help &amp;gt; Scripting Index &amp;gt; Functions&amp;gt;Run Program.&lt;/P&gt;&lt;P&gt;Attached is a script written for chapter 9 of &lt;STRONG&gt;JSL Companion, Applications of the JMP Scripting Languge, Second Edition&lt;/STRONG&gt;.&amp;nbsp; It includes multiple methods for reading multiple commands; multple commands to one program, or multiple DOS commands.&amp;nbsp; See example #5 in this script for multiple dos commands (cd, dir, etc.) The discussion notes start on line 199 and the JSL is on line&amp;nbsp; 253 to 287.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are just wanting to take notes, during your session, here is a simple script that does not require Run Program.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

noteslst ={};
InsertInto(noteslst, char(AsDate(Today()))|| " Notes");
InsertInto(noteslst, "Hello, World!");
InsertInto(noteslst,"It's hot here, 99 degrees");
InsertInto(noteslst,"Time to cool off");
InsertInto(noteslst,"Good Bye");

xtxt = Concat Items(noteslst,"\!N");
Save Text File( "c:\temp\July23Notes.txt" , xtxt);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jul 2018 01:19:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63720#M34093</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-07-24T01:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using RunProgram to start cmd.exe and execute commands</title>
      <link>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63777#M34117</link>
      <description>&lt;P&gt;perfect, thanks.&amp;nbsp; I can't believe i've never noticed the multiple example drop down list.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 14:24:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-RunProgram-to-start-cmd-exe-and-execute-commands/m-p/63777#M34117</guid>
      <dc:creator>MarcB</dc:creator>
      <dc:date>2018-07-24T14:24:03Z</dc:date>
    </item>
  </channel>
</rss>

