1

I'm very much a beginner when it comes to web development, and I'm not at all familiar with Windows. I have a curl script that runs on my Mac, but I need to be able to run it on a Windows machine.

I've installed Cygwin (I think? I downloaded something off of that site) but I still don't know how to execute the script.

Typing cmd.exe script_name.sh into the command prompt window returns "Microsoft Windows version 10 2015 Microsoft Corporation". No errors, nothing.

Pasting the entire script into the command prompt returns "curl is not recognized as an internal or external command, operable program or batch file".

Here is my script (modified to remove passwords and such): curl -X POST \ "http://USERNAME:PASSWORD@localhost:8080/api/v2/projects/PROJECT_NAME/cards/CARD_NUM/attachments.xml" -F "file=@/path/to/file/file_name.pdf"

Can someone please explain to me very slowly how to execute this thing? I feel completely stupid and frustrated because all I need to do on my Mac is type ./script.sh and it works. I've spent the past few days googling everything I can think of and nothing is working. Thank you very much for your help.

ErinJoan
  • 43
  • 1
  • 5

1 Answers1

0

You get an error about Curl when using the normal cmd.exe on Windows because cURL doesn't exist by default in the cmd prompt.

There are a few ways to solve your problem.

(1) Since you've already installed Cygwin you can use that. Instead of trying to use cmd to run your shell script, open up the Cygwin Terminal and use it instead. cURL should be installed by default so you just open up the Cygwin Terminal and type in:

curl http://google.com 

and boom you get a response rather than a cURL not found.

(2) Download cURL for windows from here: http://curl.haxx.se/download.html And then put it into a directory in your PATH environment variable (ie: C:\Windows\System32) or put it in C:\Curl and add that to your PATH. Close your cmd prompt, reopen it, and you should be able to Curl away.

Log_n
  • 404
  • 2
  • 5
  • When I type curl http://google.com into the Cygwin terminal I get "-bash: curl: command not found. Is there a step that I missed? – ErinJoan Mar 05 '15 at 00:32
  • Ah, I thought cURL was installed by default on Cygwin, guess it isn't. Double click your Cygwin setup file and in the part where you can select packages search for curl. Under the "Net" category you will see "curl: Multi-protocol file transfer tool", click on the refresh icon until it says you will be installing it (in the new column there will be a version number). Then hit next and install. There's pictures in this answer that may prove helpful: http://stackoverflow.com/questions/3647569/how-do-i-install-curl-on-cygwin – Log_n Mar 05 '15 at 00:38