Create a gist now

Instantly share code, notes, and snippets.

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

@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

thanks

@yangxun

Thx

@ShawnLe

big thanks!

@phuocpkaf

thanks

@listofoptions

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

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

As for alternative, I did:

  • edit environment variables to add the variable HOME as %USERPROFILE%
  • add your curl.exe directory in PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment