I need to use cURL from the batch file (.bat) in Windows. My script is the following:
@echo off
curl "https://...url1..." -o "D:/path/file1.htm" "https://...url2..." -o "D:/path/file2.htm"
(here "https://...urlN..." represents a particular URL).
I have two questions:
- It seems that there is something wrong in the code: I only get two empty files in the output directory. In the command-line interface I see that cURL starts, but downloads zero bytes of data. Where is the problem? If I copy the command and paste it into the terminal, it works as expected.
- If I have multiple occurrences of
"https://...urlN..." -o "D:/path/fileN.htm"for a singlecurlcommand, how to put all of them to separate lines (that is, each occurrence of"https://...urlN..." -o "D:/path/fileN.htm"must be placed in a separate line)?
curl "https://...url1..." -o "D:/path/file1.htm" & curl "https://...url2..." -o "D:/path/file2.htm"curl ... & curl ...is not suitable in my situation; my question is about using a singlecurlcommand.curl.bat, did you?