Re: running another program with system / system_exec

new topic     » goto parent     » topic index » view thread      » older message » newer message
ChrisB said...

Hi

I have this :

A long\path name\with spaces\to an\executable.exe

that I want to load

A long\path name\with spaces\to a\graphic_file

with

How do I do this with system and system_exec balking at the spaces.

If I do

'"'A long\path name\with spaces\to an\executable.exe'"'

then the program loads

but when I try to add the file I want it to load, nothing happens, ie

'"'A long\path name\with spaces\to an\executable.exe A long\path name\with spaces\to a\graphic_file'"'

Do I somehow have to quote the file_to_load?

Chris

I quote everything, separately, and quote the spaces between the elements of the command. I also found it's sometimes best to build a complete string, and pass that to system_exec(), at least that way you can puts the string and see if it is what you exected. Worst case, like dealing with Privoxy, i write a .bat file and exec that.

savefile = current_dir() & "\\wget\\tmp.txt" 
system("del " & savefile,2) 
 
junk = system_exec(current_dir() & "\\wget\\wget.exe --connect-timeout=20 --read-timeout=20 -T10 -A txt,html,htm -qO "&savefile&" "&filename,2) 
 

If the lines are really long, you may hit a line length limit in dos.

useless

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu