Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

There's some syntax that I'm missing here. Running this batch file:

for /d %a in ("c:\Documents and Settings\*.*") do mkdir "%a\Application Data\vlc"
for /d %a in ("c:\Documents and Settings\*.*") do echo qt-privacy-ask=0 > "%a\Application Data\vlc\vlcrc"

And I get this output:

\Documents was unexpected at this time.
share|improve this question
up vote 1 down vote accepted

yeah you got it, official reference: microsoft

FOR command

Use %variable to carry out for from the command prompt. Use %%variable to carry out the for command within a batch file.

share|improve this answer

I found the issue... it seems like batch needs double %% for variables? Not sure but this worked:

for /d %%a in ("c:\Documents and Settings\*.*") do (
    mkdir "%%a\Application Data\vlc"
    echo qt-privacy-ask=0 > "%%a\Application Data\vlc\vlcrc" 
share|improve this answer

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.