Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(This is on NT based Windows like 2000, XP, Vista, 7)

On the command-line, the percentage characters are ignored:

wget ""

So it correctly downloads this file (each %20 becomes a space):

" voor verwerkers persoonsgegevens_tcm34-3940.pdf"

But inside a batchfile, all the %20 are being interpreted as expanding parameter 2 (which is empty) resulting in this file to get downloaded (each %20 becomes 0):


Is there a way to circumvent the percentage parameter expansion?


share|improve this question
up vote 9 down vote accepted

Double the percent sign:

wget ""
share|improve this answer
+1 thanks- this worked. – Jeroen Wiert Pluimers Dec 25 '09 at 11:26

% is used for variables in Windows' cmd.exe (and its predecessor

The escape character in cmd.exe is ^:

> echo foo^%bar
share|improve this answer
this does not work from inside a batch file; but Snark's solution works. This is the batch-file I tested: wget "…; wget "^%20voor^%20verwerkers^%20persoonsgege‌​vens_tcm34-3940.pdf" – Jeroen Wiert Pluimers Dec 25 '09 at 11:26
I did know @Snark's solution, but I wouldn't have guessed that this wouldn't also work. Surprising. – user1167442 Nov 5 '14 at 20:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.