David
David

Reputation: 10738

create curl command in windows 7 command line

I downloaded the curl.exe file from the curl website and put it in my c drive. C:\curl.exe . How do I make that a shortcut in the command line?

For instance, instead of typing "C:\curl http://www.google.com", I would like to just type "curl http://www.google.com"

Upvotes: 1

Views: 4402

Answers (3)

David
David

Reputation: 10738

I figured it out. Instead of adding the curl.exe file to just C:\, i added it to the C:\Windows directory

Upvotes: 0

SirDarius
SirDarius

Reputation: 42869

Put it in a directory that will be searched for by the command processor by adding it to the PATH environment variable.

For instance:

C:\Windows> set PATH=%PATH%;c:\

C:\Windows> curl "http://www.google.com"

This will work.

You can use the command path in the command prompt to get the current list of directories that are in the PATH.

Of course, I don't recommend putting curl.exe at the C:\ root, but in a more secure location, like in your personal directory C:\Users\YourName.

Upvotes: 2

Mike Christensen
Mike Christensen

Reputation: 91580

You'll need to put curl.exe in a directory within your path, such as c:\WINDOWS\ (type PATH to see all the directories in your system path) or put it in its own directory, then add that directory to your path.

For example, if you put curl.exe within C:\Utils, you can add this directory to your path by typing:

SET PATH=%PATH%;C:\Utils

To make this permanent, go to Control Panel / System and Security / System, click on Advanced System Settings, click Environment Variables, and modify the "Path" variable under System Variables. Just stick ;C:\Utils at the end.

Upvotes: 1

Related Questions