0

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.
Luca Matteis
  • 548
  • 4
  • 11
  • 21

2 Answers2

1

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" 
)
Luca Matteis
  • 548
  • 4
  • 11
  • 21
1

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.

BoyMars
  • 1,012
  • 1
  • 6
  • 15