1

An example would be:

 Folder 1:
  a.pdf
  b.pdf
   Folder11
   c.pdf
  Folder 2:
  a.pdf
  b.pdf
   Folder21:
   c.pdf

printing all files between folders

And the cmd would have a way to find the file only putting part of the words? Example

TEXT : ABC*.PDF

PRINT ABCDF.PDF

Mofi
  • 46,139
  • 17
  • 80
  • 143
Pedro
  • 13
  • 6

1 Answers1

0

1. To loop over multiple files recursively:

FOR /f "tokens=*" %%F in ('dir /s /b *.pdf') DO echo "%%F"
  • dir /s /b *.pfd finds all pdfs (*.pdf), in all subdirectories (/s), in bare format - ie just the path name (/b)
  • DO echo "%%F" just echo's the result to the console.
  • "tokens=*" adds the whole line into %%F regardless of white spaces / other tokens
  • /F makes it run the ('dir ...') command

2. To print from command line use: From this question

AcroRd32.exe /t "C:\Folder\File.pdf" "Brother MFC-7820N USB Printer" "Brother MFC-7820N USB Printer" "IP_192.168.10.110"

Note: Path to AcroRd32.exe must be in your path environment variable

3. Putting it all together -- edit -- 'I've added taskkill to close acrord32 after printing

FOR /f "tokens=*" %%F in ('dir /s /b *.pdf') DO AcroRd32.exe /t "%%~F" "Brother MFC-7820N USB Printer" "Brother MFC-7820N USB Printer" "IP_192.168.10.110" & taskkill /IM AcroRd32.exe
Community
  • 1
  • 1
FloatingKiwi
  • 4,408
  • 1
  • 17
  • 41