Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6744695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:06:52+00:00 2026-05-26T12:06:52+00:00

I am looking for either a batch file or a vbscript that will merge

  • 0

I am looking for either a batch file or a vbscript that will merge like pdf file names. The files that should be combine will have the same file name all the way to the first “.” I have entire folders that contain about 4000 files. The file extensions match the following format

1111111111111111.22222222.pdf ==> 1 is any 16 numbers 0-9 and 2 is any 8 numbers 0-9

I would like to merge the like files of the folder in batch style. All the files that have identical file name up to the first should be merged “.”

Example: 1111111111111111.25484686.pdf should merge with 1111111111111111.54874568 while 5555555555555555.78468767 should merge with 5555555555555555.48687654 and 5555555555555555.68974582

The files could be outputted to another folder but is not required. The new file name after it is outputted doesnt matter either as long as it works.

I know that there is software that is out there that will handle this but it would take too long to drag and drop all like files to merge them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:06:52+00:00Added an answer on May 26, 2026 at 12:06 pm

    A Google search found http://www.pdfsam.org/ – a site that offers a free PDF merge utility that has a command line interface (as well as a GUI). I have no idea how well this works. Make sure you get the free utility offered by this site and not the competitor’s solution that is advertised on the same site.

    There are many other utilities out there, most of them for a fee.

    Once you figure out how to use the command line interface of your utility of choice, you can use a batch file like the one below to dynamically build your list of files to merge. (This batch code is untested. The concept will definitely work, but it may need some debugging)

    @echo off
    setlocal enableDelayedExpansion
    
    :: This initial loop determines which files need to be merged
    :: and then calls :merge for each unique set of files. This top
    :: loop should work no matter what utility you choose.
    set "current="
    set cnt=0
    :: for current directory, LOC should be empty (or .\)
    :: for any other path, LOC should include \ at end
    set "LOC="
    for %%F in ("%LOC%*.*.pdf") do (
      for /f "tokens=1,* delims=." %%A in ("%%~nF") do (
        if "%%A" neq "!current!" (
          if defined current call :merge
          set cnt=0
          set current=%%A
        )
        set /a cnt+=1
        set pdf.!cnt!=%%~fF
      )
    exit /b
    
    
    :merge
    :: This routine should build the command line to merge the current
    :: file list contained in pdf.1 through pdf.!cnt!
    ::
    :: Below is code to build a hypothetical file list to be used on
    :: the merge command line. This will obviously need to be modified
    :: based on the syntax of your chosen merge utility.
    ::
      set "list="
      for /l %%N in (1 1 !cnt!) do set list=!list! -f "!pdf.%%N!"
    ::
    ::
    :: The rest is up to you!
    ::
    exit /b
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for either a FireFox extension, or a similar program, that allows
I'm looking for a way to create a data access layer that can either
I am really looking for either a small code snippet. I have a C#
I have an application that I will soon be doing a significant rewrite of
I am looking for a free tool that allows re-arranging pages of a PDF
I am looking for either a NAnt Task for SQL Server bcp, or the
Looking to implement a RIA (rich internet application) either as a java (JWS) application
I am looking for a command line either for an algorithm (script) which allows
I am looking for an effective way to either clone/rename or re-create address fields
I'm looking for an open-source pastebin web-application written in either Python or Perl. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.