cURL 命令失败
我正在尝试在我正在编写的批处理文件中使用curl 命令。我已经下载了最新的curl可执行文件并运行它,但我无法使用命令“curl”我应该采取什么步骤才能正确使用它?命令行仍然显示
“curl 未被识别为内部或外部命令、可用程序或批处理文件”
我对使用 cURL 执行任何其他操作不感兴趣
I am attempting to use curl commands in a batch file I am writing. I have downloaded the latest curl executable and run it but I cannot use the command "curl" What steps should I take to use it correctly? The Command line still says
"curl is not recognized as an internal or external command, able program or batch file"
I am not interested in doing anything else with cURL
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您必须将包含
curl.exe
的目录添加到您的path
中,可能是bin
目录。在 Windows XP 中,您可以通过以下方式执行此操作:
path
并将路径添加到您的curl 目录You will have to add the directory containing
curl.exe
to yourpath
, probably thebin
directory.In Windows XP you can do this by:
path
in the list and add the path to your curl directory在 Windows 上安装 cURL 的步骤
在 Windows 上安装 cURL
要在 Windows 上安装 cURL,需要执行 4 个步骤。
第1步和第2步是安装SSL库。
第 3 步是安装 cURL。
第 4 步是安装最新的证书
第一步:安装 Visual C++ 2008 Redistributables
下载 Visual C++ 2008 Redistributables。
第二步:安装 Win(32/64) OpenSSL v1.0.0k Light
也来自 http://www.shininglightpro.com/products/Win32OpenSSL.html
对于64位系统
Win64 OpenSSL v1.0.0k 轻量级
对于32位系统
Win32 OpenSSL v1.0.0k Light
第三步:安装cURL
根据您的系统是32位还是64位,下载相应的**curl.exe。**
例如,转到 Win64 - 通用部分并下载支持 SSL 的 Win64 二进制文件(SSL 未被划掉的二进制文件)。
访问http://curl.haxx.se/download.html
更具体的链接: http://curl .haxx.se/latest.cgi?curl=win64-ssl-sspi
将curl.exe复制到C:\Windows\System32
第四步:安装最近的证书
不要跳过此步骤。
从 http://curl.haxx.se/ca/cacert 下载有效 CERT 文件的最新副本.pem
将其复制到放置curl.exe的同一文件夹(C:\Windows\System32)并将其重命名为curl-ca-bundle.crt
如果您已经安装了
curl
或执行上述步骤后,将其安装目录添加到 Windows 路径:1 - 在桌面上,右键单击我的电脑,然后单击属性。
2 - 单击高级系统设置。
3 - 在“系统属性”窗口中单击环境变量按钮。
4 - 选择路径,然后单击编辑。
5 - 在末尾附加 ;c:\curl 目录的路径。
5 - 单击确定。
6 - 关闭并重新打开命令提示符
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
Download Visual C++ 2008 Redistributables.
Step Two: Install Win(32/64) OpenSSL v1.0.0k Light
Also 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
More specific Link: http://curl.haxx.se/latest.cgi?curl=win64-ssl-sspi
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 http://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
看起来它不在您的路径上 - 尝试打开一个新的控制台窗口。
Looks like its not on your path - try opening a new console window.
您需要将其添加到路径环境变量中。如果您想通过批处理来完成此操作,则可以使用curl.exe更新它存储目录的reg密钥,如下所示:
或者如果exe不依赖于任何其他文件,您可以将其复制到现有目录的路径,例如< code>C:\Windows\system32.
希望这会有所帮助!
You need to add it to the path environment variable. If you want to do it through batch then you can update the reg key it stores the directories in with curl.exe like this:
Or if the exe isn't dependent on any other files you could copy it to of paths existing directories like
C:\Windows\system32.
Hope this helps!