使用百分号(%)作为CMD参数被解释为一个变量 [英] Use of percent sign (%) as a CMD parameter is interpreted as a variable

查看:1660
本文介绍了使用百分号(%)作为CMD参数被解释为一个变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下代码运行批处理文件:

I try to run a batch file with the following code:

wget.exe "http://example.com/file0%24.html"

问题是,CMD正在解释%2 作为变量(第二个命令行参数),因为它未定义,所以它为空。

The problem is, that CMD is interpreting the %2 as a variable (the second command line parameter) and since it isn't defined, it's empty.

有解决方法吗?

推荐答案

发送百分号。

wget.exe "http://example.com/file0%%24.html"

这篇关于使用百分号(%)作为CMD参数被解释为一个变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆