Use of percent sign (%) as a CMD parameter is inte

2020-03-24 07:04发布

问题:

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

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

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.

Is there a workaround?

回答1:

Use a double-percent sign to send a percent literal.

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


回答2:

You can escape % as %%

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

http://support.microsoft.com/kb/75634