divide documents into subfolders

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
adill441
Posts: 14
Joined: 09 Aug 2012 12:21

divide documents into subfolders

#1 Post by adill441 » 09 Aug 2012 12:26

Hello All

Please help me in this regard

we receive zip files so we extract them and we get hundreds of word files in a folder and i want to divide them into subfolders each subfolder should contain 40 documents after separating them we need to convert word documents into PDF its taking time for separating them.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: divide documents into subfolders

#2 Post by foxidrive » 09 Aug 2012 12:42

adill441 wrote:we receive zip files so we extract them and we get hundreds of word files in a folder and i want to divide them into subfolders each subfolder should contain 40 documents


Try this: (untested)

Code: Select all

@echo off
setlocal EnableExtensions EnableDelayedExpansion
set num=1
set c=0
for /f "delims=" %%a in ('dir *.doc /b') do (
if !c! LSS 40 (
      md "files!num!" 2>nul
      move "%%a" "files!num!"
   ) else (
      set /a num+=1
      set c=0
   )
set /a c+=1
)

adill441
Posts: 14
Joined: 09 Aug 2012 12:21

Re: divide documents into subfolders

#3 Post by adill441 » 09 Aug 2012 19:56

Thank You!!!! :D is there any thing by which we can change this word documents into PDF ?


adill441
Posts: 14
Joined: 09 Aug 2012 12:21

Re: divide documents into subfolders

#5 Post by adill441 » 09 Aug 2012 20:35

Hello Foxidrive

i have these software install C:\Program Files (x86)\PDFCreator and i cannot install any new softwate Please advise

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: divide documents into subfolders

#6 Post by foxidrive » 09 Aug 2012 20:53

I got this from the link above - try it from a cmd prompt and see if it works for you. If so without any prompts then a batch file can help.

Code: Select all

"winword.exe" "file.doc" /mFilePrintDefault



I think you will need to set the default printer to be pdfcreator.

adill441
Posts: 14
Joined: 09 Aug 2012 12:21

Re: divide documents into subfolders

#7 Post by adill441 » 09 Aug 2012 21:57

Hello Foxidrive

Yeah its working i have put this into the cmd prompt an pdf creator is oepning i have made default printer to be pdfcreator but we have to save each file and i have hundreds file to be converted

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: divide documents into subfolders

#8 Post by Squashman » 10 Aug 2012 06:02

Did you happen to read the user manual. I think you will find you answer there.
http://www.pdfforge.org/content/pdfcreator-user-manual

adill441
Posts: 14
Joined: 09 Aug 2012 12:21

Re: divide documents into subfolders

#9 Post by adill441 » 10 Aug 2012 22:27

Hello Squashman

Please check is this correct

C:\Users\mullahshareef\Desktop\Staters\New folder\PDFCreator.exe/PF"C:\Users\mullahshareef\Desktop\Staters\New folder"

Post Reply