43

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.

Nevin Raj Victor
  • 2,924
  • 3
  • 23
  • 37
  • 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. – Nevin Raj Victor Feb 26 '15 at 07:30
  • 2
    What happens when you call curl with its full path? – SomethingDark Feb 26 '15 at 07:31
  • @SomethingDark: It's giving : curl: <6> could not resolve host :C – Nevin Raj Victor Feb 26 '15 at 07:33
  • @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 "ipa=@android.apk" \ -H "X-HockeyAppToken:TOKEN" \ https://rink.hockeyapp.net/api/2/apps/APP_ID/app_versions/upload' – Nevin Raj Victor Feb 26 '15 at 07:39
  • 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. – SomethingDark Feb 26 '15 at 08:04
  • @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??? – Nevin Raj Victor Feb 26 '15 at 09:03
  • The only other thing I can think of is that you might need to escape the \ characters by preceding them with a ^ – SomethingDark Feb 26 '15 at 09:11
  • @SomethingDark: It's still not working..Anyway thanks for your time – Nevin Raj Victor Feb 26 '15 at 09:21

3 Answers3

98

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

Nevin Raj Victor
  • 2,924
  • 3
  • 23
  • 37
  • 1
    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. – Paul Wright Sep 11 '15 at 09:58
  • Like Paul, I wasn't able to find the item in `step 1` but it worked correct! Thanks for the detailed guide, +1 – benscabbia Feb 01 '16 at 14:29
  • 1
    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. – Radmation Apr 07 '16 at 18:05
  • 1
    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. – Chad Oct 15 '18 at 19:40
  • Same as above in windows 10 curl is already there in system32/curl.exe then how should we configure it in Environment variable. – Dhwanil Patel May 20 '20 at 10:44
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

Pre_hacker
  • 1,352
  • 1
  • 17
  • 21
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"

Hassan Saeed
  • 6,326
  • 1
  • 39
  • 37