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

i want to find all the *.pdf files(including the pdf with the same name)for all 3 of my partitions C,D and F and put them into a .rar or .zip.when i started i wanted to just copy the pdf into a file but i realised it wasnt enough for what i wanted.can anyone give me any pointers?I had writen this

mkdir d:\test

mkdir f:\test1

chcp 65001

XCOPY C:*.pdf D:test /S /H

XCOPY F:*.pdf D:test /S /H

XCOPY D:*.pdf F:test1 /S /H

copy f:\test1 d:\test\kra\
share|improve this question

migrated from May 16 '13 at 8:30

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

Assuming you have installed WinRARor a similar pack program:

for %%i in (c: d: f:) do for /f "delims=" %%j in ('dir /s /a-d /b %%i\*.pdf') do "C:\Program Files\WinRAR\Rar.exe" a myarchive "%%~j"
share|improve this answer
Hey mate i do have winrar in the folder C:\Program Files\WinRAR\Rar.exe the thing is i dont get what you have written and as it is it doesnt run.also where it will make the rar? – user2237380 Apr 2 '13 at 21:04
made an edit concerning your path to WinRar. – Endoro Apr 2 '13 at 21:16
i made this for %%i in (c: d: f:) do for /f "delims=" %%j in ('dir /s /a-d /b %%i*.srt') do "C:\Program Files\WinRAR\rar.exe" a d:\test.rar "%%~j" the problems is for example i checked the srt files i had 23 in the pc in the rar i have only 21 meaning i lose 2 – user2237380 Apr 2 '13 at 21:37
Sorry, can't verify this here. It does work for me. – Endoro Apr 2 '13 at 21:54
It seems like my pc is the problem i have problems with other programs as well after i deleted some srt files for example the computers was finding 17 your program 18 the weird thing is i found the 18th srt and after i double clic it it was opening ok i ll format my pc this weekend and i l try again as it seems to have some problems.once again thank you for the help :) – user2237380 Apr 3 '13 at 5:23

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.