<?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 Re: RunProgram with spaces in a powershell command in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352194#M60152</link>
    <description>&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328" target="_self"&gt;here&lt;/A&gt; points to a thorough explanation of why the windows command line is so hard to use. The quotation marks don't really do what we think they do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd mix the apostrophes and quotation marks, as you've done, because it is easier to understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jan 2021 17:35:24 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2021-01-23T17:35:24Z</dc:date>
    <item>
      <title>RunProgram with spaces in a powershell command</title>
      <link>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/351821#M60130</link>
      <description>&lt;P&gt;I am getting an error loading a string that has spaces and I need to pass between double quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

parameter_A = "this has spaces";
parameter_B = "specific.domain.com";

command = "program -Name \!"" || parameter_A ||"\!" -Path \!"" || parameter_B || "\!"";

write(command );
// outputs the expected:
// program -Name "this has spaces" -Path "specific.domain.com"&lt;BR /&gt;
add_result = RunProgram(
			Executable( "powershell.exe" ),
			Options( {"/c", command } ),
			ReadFunction( "text" ));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The &lt;CODE class=" language-jsl"&gt;parameter_A &lt;/CODE&gt;&amp;nbsp; breaks the execution as it thinks there are more arguments passed. Yet, the command works if I copy and paste the output of write in powershell.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:04:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/351821#M60130</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2023-06-09T22:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: RunProgram with spaces in a powershell command</title>
      <link>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352169#M60146</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

parameter_A = "this has spaces";
parameter_B = "specific.domain.com";

command = "powershell "\!"program -Name '" || parameter_A ||"' -Path '" || parameter_B || '"\!"";

write(command );
// outputs the expected:
// powershell "program -Name 'this has spaces' -Path 'specific.domain.com'"
add_result = RunProgram(
			Executable( "cmd.exe" ),
			Options( {"/C", command } ),
			ReadFunction( "text" ));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This worked for me, not sure if there is a better solution that doesn't use single quotes.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 08:55:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352169#M60146</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2021-01-23T08:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: RunProgram with spaces in a powershell command</title>
      <link>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352170#M60147</link>
      <description>&lt;P&gt;This has helped me earlier with similar case:&amp;nbsp;&lt;LI-MESSAGE title="Pass quote into Run Program application" uid="207567" url="https://community.jmp.com/t5/Discussions/Pass-quote-into-Run-Program-application/m-p/207567#U207567" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;escapedquote = "\!\\!"";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 13:10:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352170#M60147</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-01-25T13:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: RunProgram with spaces in a powershell command</title>
      <link>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352194#M60152</link>
      <description>&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Unable-to-parse-speechmarks-quot-quot-into-powershell-using/m-p/245968/highlight/true#M48328" target="_self"&gt;here&lt;/A&gt; points to a thorough explanation of why the windows command line is so hard to use. The quotation marks don't really do what we think they do.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd mix the apostrophes and quotation marks, as you've done, because it is easier to understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 17:35:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/RunProgram-with-spaces-in-a-powershell-command/m-p/352194#M60152</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2021-01-23T17:35:24Z</dc:date>
    </item>
  </channel>
</rss>

