<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Adding a backslash (\) before each space should do the job
nicely. I have had similar issues on linux and windows with some
commands, and adding the escape characters to the filename almost
always fixes the problem. The only time it didn't, was when the
filename started with a dash "-" character. Otherwise, the
backslash always works for me.</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 9/20/2022 4:16 PM, Jean SUZINEAU via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:76fbb4e2-1cd3-7d10-d54f-c954e785fefc@wanadoo.fr">
<p>May be by escaping the spaces with ^ ?</p>
<p>Something like:Â MyFileName:= StringReplace(MyFileName, ' ', '^
', [rfReplaceAll]);<br>
</p>
<p>^ is the escape char for cmd.exe but may be it is active in
this context too ?<br>
</p>
<div class="moz-cite-prefix">Le 20/09/2022 Ã 18:31, James Richters
via fpc-pascal a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:084801d8cd0e$75e863b0$61b92b10$@productionautomation.net">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 15">
<meta name="Originator" content="Microsoft Word 15">
<div class="WordSection1">
<p class="MsoNormal"><span>I just tried it that way:</span></p>
<p class="MsoNormal"><span>Var </span></p>
<p class="MsoNormal"><span class="SpellE"><span>pcmd</span></span><span>:
String;</span></p>
<p class="MsoNormal"><span class="SpellE"><span>MyFileName</span></span><span>:
String;</span></p>
<p class="MsoNormal"><span>Â </span></p>
<p class="MsoNormal"><span class="SpellE"><span>pcmd</span></span><span>:='play
"'+<span class="SpellE">MyFileName</span>+'"'+#0;</span></p>
<p class="MsoNormal"><span class="SpellE"><span>mciSendString</span></span><span>(@pcmd[1],Nil,0,0);</span></p>
<p class="MsoNormal"><span>Â </span></p>
</div>
<br>
</blockquote>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
</pre>
</blockquote>
</body>
</html>