+ Reply to Thread
Results 1 to 2 of 2

Windows XP : Batch file run program in all subfolders

  1. #1
    Registered User
    Join Date
    04-13-2010
    Location
    Taiwan
    MS-Off Ver
    Excel 2007
    Posts
    25

    Batch file run program in all subfolders

    Don't know if this is the right place to pose this question, but i am desperate i hope someone can give me a solution.

    I have some documents that are scanned into tiff files. The files are in single page tiff format, so each file is only has one page of the document. Now I am trying to combine the single-page tiff files into a multi-page tiff file

    Now all the files are in the “E:\scanned” folder

    In the E:\scanned folder, there are hundreds of subfolders. The names of the subfolders are the serial number of the documents.
    For example:
    E:\scanned\00102681
    E:\scanned\00101257
    E:\scanned\01015781

    And each subfolder has several of single-page tiff file.
    For example:

    E:\scanned\00102681\00102681-0001.tif
    E:\scanned\00102681\00102681-0002.tif
    E:\scanned\00102681\00102681-0003.tif

    E:\scanned\00101257\00102681-0001.tif
    E:\scanned\00101257\00102681-0002.tif
    E:\scanned\00101257\00102681-0003.tif
    E:\scanned\00101257\00102681-0004.tif

    E:\scanned\01015781\01015781-0001.tif
    E:\scanned\01015781\01015781-0002.tif


    I found a program online called the IrfanView, which can combine single-page tiff files into a multi-page tiff. Someone even wrote a .bat command for combining all the single page within a folder and produce a multi-page tiff file called final.tif saved in the same folder.

    Please Login or Register  to view this content.
    Now, here is the question.
    Since I don’t want to run that program hundreds of times, can someone help me modify the codes, so that if I put the .bat file in the E:\scanned folder, the .bat file would go to each subfolder, run the program, and the combined files have the same name as the folder names. Such as

    E:\scanned\00102681\00102681.tif
    E:\scanned\00101257\00101257.tif
    E:\scanned\01015781\01015781.tif

    It would be even better if all the combined files are saved in one folder. For example

    E:\scanned\combined\00102681.tif
    E:\scanned\combined\00101257.tif
    E:\scanned\combined\01015781.tif
    Last edited by bruce71101; 05-31-2012 at 09:07 PM.

  2. #2
    Registered User
    Join Date
    04-13-2010
    Location
    Taiwan
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Batch file run program in all subfolders

    My coworker came up with another solution that takes a few step, but it is easy to understand.

    Two .dat files are created, one called combine.bat, the other one called combineN.bat, they are both in the e:\scanned folder



    the code of combineN.bat

    Please Login or Register  to view this content.

    the code of combine.bat
    Please Login or Register  to view this content.

    I need to run
    Please Login or Register  to view this content.
    in the cmd to get a list of all the folders first and add them to combineN.bat

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1