Instantly share code, notes, and snippets.

@gmarik /curl.cmd forked from morhetz/curl.cmd
Created Apr 11, 2011

Embed
What would you like to do?
@rem Do not use "echo off" to not affect any child calls.
@setlocal
@rem Get the abolute path to the parent directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@curl.exe %*
@namavivarjita

This comment has been minimized.

Show comment
Hide comment
@namavivarjita

namavivarjita commented Nov 26, 2013

thanks

@yangxun

This comment has been minimized.

Show comment
Hide comment
@yangxun

yangxun commented Jun 21, 2014

Thx

@ShawnLe

This comment has been minimized.

Show comment
Hide comment
@ShawnLe

ShawnLe Jun 29, 2015

big thanks!

ShawnLe commented Jun 29, 2015

big thanks!

@phuocpkaf

This comment has been minimized.

Show comment
Hide comment
@phuocpkaf

phuocpkaf commented Jul 31, 2015

thanks

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jan 2, 2016

note: latest version (v2.6.4) of msysgit (now git for windows: https://git-for-windows.github.io/) require editing line 7 from
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
to
@set PATH=%git_install_root%\bin;%git_install_root%\mingw32\bin;%PATH%

ghost commented Jan 2, 2016

note: latest version (v2.6.4) of msysgit (now git for windows: https://git-for-windows.github.io/) require editing line 7 from
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
to
@set PATH=%git_install_root%\bin;%git_install_root%\mingw32\bin;%PATH%

@lujimin

This comment has been minimized.

Show comment
Hide comment
@lujimin

lujimin Mar 17, 2016

note: if you use a 64-bit system, you should edit line 7 from
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
to
@set PATH=%git_install_root%\bin;%git_install_root%\mingw64\bin;%PATH%

lujimin commented Mar 17, 2016

note: if you use a 64-bit system, you should edit line 7 from
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
to
@set PATH=%git_install_root%\bin;%git_install_root%\mingw64\bin;%PATH%

@MatteoRagni

This comment has been minimized.

Show comment
Hide comment
@MatteoRagni

MatteoRagni Apr 14, 2016

As for alternative, I did:

  • edit environment variables to add the variable HOME as %USERPROFILE%
  • add your curl.exe directory in PATH

MatteoRagni commented Apr 14, 2016

As for alternative, I did:

  • edit environment variables to add the variable HOME as %USERPROFILE%
  • add your curl.exe directory in PATH
@aalasolutions

This comment has been minimized.

Show comment
Hide comment
@aalasolutions

aalasolutions Nov 23, 2016

I have simply created a bat file having

"C:\Program Files\Git\mingw64\bin\curl.exe" %*

And then added that batfile to any where which is available in Environment Variable

aalasolutions commented Nov 23, 2016

I have simply created a bat file having

"C:\Program Files\Git\mingw64\bin\curl.exe" %*

And then added that batfile to any where which is available in Environment Variable

@Alvion101

This comment has been minimized.

Show comment
Hide comment
@Alvion101

Alvion101 Jan 1, 2018

Hi i am really new here. I just want to find out I copied exactly what was written. But was greeted with curl: (6) Could not resolve host: %*
can anyone explain to me where did I go wrong? I have my git installed, I have Vim installed. Where did I go wrong?

Alvion101 commented Jan 1, 2018

Hi i am really new here. I just want to find out I copied exactly what was written. But was greeted with curl: (6) Could not resolve host: %*
can anyone explain to me where did I go wrong? I have my git installed, I have Vim installed. Where did I go wrong?

@Mendrell

This comment has been minimized.

Show comment
Hide comment
@Mendrell

Mendrell Jan 12, 2018

Thank you so much for releasing this it worked perfectly on my laptop, however i tried setting it up on my desktop and it constantly says that it is incompatible claiming it is a 16 bit program i made sure my system was 64 bit which it was and changed the line to
@set PATH=%git_install_root%\bin;%git_install_root%\mingw64\bin;%PATH%
but it doesn't make a difference is there something else i have to change as well, I am a bit confused seeing as how it worked just fine on my laptop.

Mendrell commented Jan 12, 2018

Thank you so much for releasing this it worked perfectly on my laptop, however i tried setting it up on my desktop and it constantly says that it is incompatible claiming it is a 16 bit program i made sure my system was 64 bit which it was and changed the line to
@set PATH=%git_install_root%\bin;%git_install_root%\mingw64\bin;%PATH%
but it doesn't make a difference is there something else i have to change as well, I am a bit confused seeing as how it worked just fine on my laptop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment