Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9673

curl command failing in a script

$
0
0

I am new to batch scripting. I am trying to create a batch wrapper script which uses curl to get HTTP code for a site

The curl command works in CMD:

curl -s -w "%{http_code}" https://www.sample.com/

However, if I put this in a batch script, it throws an error:

curl: no URL specified!

curl: try 'curl --help' or 'curl --manual' for more information

Below is the batch script:

ECHO OFF

curl -s -w "%{http_code}" https://www.sample.com/

Is there anything I am doing wrong. Please advise.


Viewing all articles
Browse latest Browse all 9673

Trending Articles