Curl not recognized as an internal or external command, operable program or batch file
Asked Answered
P

3

44

I have installed curl and have set it as environment variable in my system. But when running the curl command its giving an error 'curl' is not recognized as an internal or external command, operable program or batch file.I tried restarting my system but is of no use.I want this to upload my application to HockeyApp. Please help me out.I am using Windows 8.1.

Preterition answered 26/2, 2015 at 7:26 Comment(8)
I know the question sounds to be a duplicated one.But I tried out almost all solutions given like adding the directory where it's installed to the windows path etc. But it's not working for me.Preterition
What happens when you call curl with its full path?Darmstadt
@SomethingDark: It's giving : curl: <6> could not resolve host :CPreterition
@SomethingDark:I am using hockey app api for uploading an android apk. Sorry for the incoorect typing format. -F and -H is not recognized 'curl \ -F "status=2" \ -F "notify=2" \ -F "[email protected]" \ -H "X-HockeyAppToken:TOKEN" \ rink.hockeyapp.net/api/2/apps/APP_ID/app_versions/upload'Preterition
Are you replacing APP_ID with your API key? Also, I'm not positive, but I believe that you don't need the `\` characters in the curl command.Darmstadt
@SomethingDark: APP_ID with app id of that particualr app and Token with the API token. " \ "character is a part of that API.I tried the same in command line of mac and its working.But in Windows???Preterition
The only other thing I can think of is that you might need to escape the \ characters by preceding them with a ^Darmstadt
@SomethingDark: It's still not working..Anyway thanks for your timePreterition
P
99

Steps to install curl in windows

Install cURL on Windows

There are 4 steps to follow to get cURL installed on Windows.

Step 1 and Step 2 is to install SSL library. Step 3 is to install cURL. Step 4 is to install a recent certificate

Step One: Install Visual C++ 2008 Redistributables

From https://www.microsoft.com/en-za/download/details.aspx?id=29 For 64bit systems Visual C++ 2008 Redistributables (x64) For 32bit systems Visual C++ 2008 Redistributables (x32)

Step Two: Install Win(32/64) OpenSSL v1.0.0k Light

From http://www.shininglightpro.com/products/Win32OpenSSL.html For 64bit systems Win64 OpenSSL v1.0.0k Light For 32bit systems Win32 OpenSSL v1.0.0k Light

Step Three: Install cURL

Depending on if your system is 32 or 64 bit, download the corresponding** curl.exe.** For example, go to the Win64 - Generic section and download the Win64 binary with SSL support (the one where SSL is not crossed out). Visit http://curl.haxx.se/download.html

Copy curl.exe to C:\Windows\System32

Step Four: Install Recent Certificates

Do not skip this step. Download a recent copy of valid CERT files from https://curl.haxx.se/ca/cacert.pem Copy it to the same folder as you placed curl.exe (C:\Windows\System32) and rename it as curl-ca-bundle.crt

If you have already installed curl or after doing the above steps, add the directory where it's installed to the windows path:

1 - From the Desktop, right-click My Computer and click Properties.
2 - Click Advanced System Settings .
3 - In the System Properties window click the Environment Variables button.
4 - Select Path and click Edit.
5 - Append ;c:\path to curl directory at the end.
5 - Click OK.
6 - Close and re-open the command prompt

Preterition answered 27/2, 2015 at 4:21 Comment(5)
Brilliant, thanks Nevin. I couldn't find the Visual C++ 2008 Redistributables in step 1, but must have them install anyway as the remaining steps worked.Exieexigency
Like Paul, I wasn't able to find the item in step 1 but it worked correct! Thanks for the detailed guide, +1Gev
Great Post! Worked just fine. For Step Four, that link opens up as a bunch of text. I just copied pasted that into a text file and then changed the name to curl-ca-bundle.crt -- you may need to have enable file extensions on to change the file extension.Cysticercus
Wait, your notes say to copy the EXE, not the source directory... so when you say "Append ;c:\path to curl directory at the end." this is very confusing because there is no curl "directory". Very confusing.Boltrope
Same as above in windows 10 curl is already there in system32/curl.exe then how should we configure it in Environment variable.Restrained
A
9

Here you can find the direct download link for Curl.exe

I was looking for the download process of Curl and every where they said copy curl.exe file in System32 but they haven't provided the direct link but after digging little more I Got it. so here it is enjoy, find curl.exe easily in bin folder just

unzip it and then go to bin folder there you get exe file

link to download curl generic

Atavistic answered 23/6, 2016 at 7:42 Comment(3)
In curl-7.53.1 there is no bin folder, rather you can find it here: src/curl.exeIncisure
find in src/ folder but not executed .Islek
Thanks a lot.. After copy and paste, i started terminal from that path and it workedShrewish
M
5

Method 1:\

add "C:\Program Files\cURL\bin" path into system variables Path right-click My Computer and click Properties >advanced > Environment Variables enter image description here

Method 2: (if method 1 not work then)

simple open command prompt with "run as administrator"

Meridith answered 9/4, 2017 at 12:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.