<?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: How to run program with whitespaces in path in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923312#M108173</link>
    <description>&lt;P&gt;Adding quotes around the path should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

base_path = "C:\Program Files\"; // works

Show(base_path);

command = Eval Insert("dir \!"^base_path^\!"");
Show(command);

RP = Run Program(
	Executable("cmd.exe"),
	Options(Insert({"/a", "/q", "/c"}, command)), 
//	ReadFunction( Function( {this}, Write( this &amp;lt;&amp;lt; read ) ) )
	readfunction("Text")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jan 2026 08:18:58 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2026-01-12T08:18:58Z</dc:date>
    <item>
      <title>How to run program with whitespaces in path</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923264#M108170</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;
&lt;P&gt;I want to zip files in current directory on win10 with JMP,&lt;/P&gt;
&lt;P&gt;so I use run program() and cmd or powershell.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But with onedrive there are whitspaces in my path, how can I get it working?&lt;/P&gt;
&lt;P&gt;Have found:&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/Open-file-in-excel-with-whitespace-in-filename/m-p/911999?search-action-id=96030372702&amp;amp;search-result-uid=911999" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/Open-file-in-excel-with-whitespace-in-filename/m-p/911999?search-action-id=96030372702&amp;amp;search-result-uid=911999&lt;/A&gt;&amp;nbsp;in usergroup, but didn't help me.&lt;/P&gt;
&lt;P&gt;Thanks!&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 );

base_path = Get Default Directory(); // doesn't work
base_path = "C:\Users\"; // works

Show( base_path );
// e.g. base_path = "/C:/Users/user/OneDrive - Documents/";
// how to mask space in path??

command = Eval Insert( "dir ^base_path^" );
// command = eval insert("\[dir "^base_path^"]\"); // doesn't work
Show( command );

RP = Run Program(
	Executable( "cmd.exe" ),
	Options( Insert( {"/a", "/q", "/c"}, command ) ), 
//	ReadFunction( Function( {this}, Write( this &amp;lt;&amp;lt; read ) ) )
	readfunction( "Text" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Jan 2026 09:20:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923264#M108170</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2026-01-11T09:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to run program with whitespaces in path</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923312#M108173</link>
      <description>&lt;P&gt;Adding quotes around the path should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

base_path = "C:\Program Files\"; // works

Show(base_path);

command = Eval Insert("dir \!"^base_path^\!"");
Show(command);

RP = Run Program(
	Executable("cmd.exe"),
	Options(Insert({"/a", "/q", "/c"}, command)), 
//	ReadFunction( Function( {this}, Write( this &amp;lt;&amp;lt; read ) ) )
	readfunction("Text")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jan 2026 08:18:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923312#M108173</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-12T08:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to run program with whitespaces in path</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923413#M108179</link>
      <description>&lt;P&gt;Hi Jarmo, thanks, your're right, I had a problem with the starting backslash as well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

base_path = "C:\Program Files\"; // works
base_path = Get Default Directory();
// starting backslash makes problems, needs to be removed
// "/C:/Users/&amp;lt;user&amp;gt;/OneDrive - Documents/"
base_path = Substr( base_path, 2, Length( base_path ) );

command = Eval Insert( "dir \!"^base_path^\!"" );
Show( command );

RP = Run Program(
	Executable( "cmd.exe" ),
	Options( Insert( {"/a", "/q", "/c"}, command ) ), 
//	ReadFunction( Function( {this}, Write( this &amp;lt;&amp;lt; read ) ) )
	readfunction( "Text" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jan 2026 10:46:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923413#M108179</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2026-01-26T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to run program with whitespaces in path</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923510#M108181</link>
      <description>&lt;P&gt;I would use Convert File Path() with "windows" argument to remove the first backslash&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

base_path = Get Default Directory();

base_path_w = Convert File Path(base_path, "windows"); // "C:\Users\&amp;lt;USERNAME&amp;gt;\Documents\"&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jan 2026 15:50:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-run-program-with-whitespaces-in-path/m-p/923510#M108181</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-01-12T15:50:36Z</dc:date>
    </item>
  </channel>
</rss>

