I just want to start a curl command in a minimized console.
this works:
START "" /B /W curl -X POST https://someurl.com -d "url_parameters_for_curl" > output.txt
But this does not work
START "" /MIN /W curl -X POST https://someurl.com -d "url_parameters_for_curl" > output.txt
I think it has something to do with the double quotes. I tried multiple escaping characters like ^ or "" and triple """ which worked for some other programs but START does not seem to be able to escape the double quotes when opening a new console window...
I've spent like 2 hours now trying to figure this out and I have no idea what to do.
PS: putting the command in a .bat file and calling it with
START /MIN /W mybat.bat
is working. But the command is generated on the fly and I don't want to write a file each time.
PPS: the command is spawned by a background process without a console window which leads to a console window popping up every time this happens. I just wanted it to appear minimized.
EDIT:
The hint with escaping the
> output.xml
with
^> output.xml OR ^>output.xml
did not work. But curl has an option to write the output to a file. So this finally worked:
START "" /MIN /W curl -X POST https://someurl.com -d "url_parameters_for_curl" -o output.txt
The question remains: How would you escape the "> outputfile" using the START command?
output.txtis empty? You redirect the output of thestartcommand - which is empty. Escape the>to pass it to the started process:...^>output.txt