Subj : system.exec() and commands in double-quotes
To   : Nightfox
From : Digital Man
Date : Wed Apr 09 2025 06:27 pm

 Re: system.exec() and commands in double-quotes
 By: Nightfox to Digital Man on Wed Apr 09 2025 05:16 pm

>   Re: system.exec() and commands in double-quotes
>   By: Digital Man to Nightfox on Tue Apr 08 2025 09:54 pm
>
>  DM> No, the double-quotes won't be removed. system.exec() is just a
>  DM> very-thing wrapper around system():
>
>  DM> Did you escape the double-quotes in the JS string passed to
>  DM> system.exec()? I think there's something else at play here.
>
> I did a bit more investigation. Since you say system.exec() is a wrapper
> around system(), I'm wondering if there may be a bug in system().
>
> It seems that the issue happens when there are multiple things in
> double-quotes.  I tried having it only run the converter program (so, the
> whole command was the fully-pathed executable in double-quotes), and that
> ran successfully.
>
> In the command line I was trying to use, I have multiple things in
> double-quotes: The fully-pathed executable is first, then possibly some
> command-line parameters, and a source filename and an output filename.  The
> fully-pathed executable, source filename, and output filename are all within
> their own set of double-quotes (in case there are spaces in their paths),
> and it seems that's when this issue happens where the Windows command
> interpreter only seems to be seeing "C:\Program" as the executable and fails
> due to that - even though the executable filename is in double-quotes.
>
> If I remove the double-quotes around the source filename & destination
> filename, so that there's only one set of double-quotes in the command line
> (around the executable), then it succeeds.

Maybe read up more about Windows system() and see if it has some magic quote parsing logic built into it that might be tripped up by quoted arguments.
--
                                           digital man (rob)

This Is Spinal Tap quote #31:
Viv Savage: Quite exciting, this computer magic!
Norco, CA WX: 77.5�F, 34.0% humidity, 10 mph W wind, 0.00 inches rain/24hrs

---
� Synchronet � Vertrauen � Home of Synchronet � [vert/cvs/bbs].synchro.net