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 8296677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:06:52+00:00 2026-06-08T15:06:52+00:00

Need to concatenate all of the javascript files in a directory and all of

  • 0

Need to concatenate all of the javascript files in a directory and all of its sub-directories into one file.

Right now I have a very simple command in a batch file that concatenates all of the matching files in one directory into one file:

copy C:\javascripts\*.js concatenated.js

However, this only works for the one directory and not any of its sub-directories. How can I do this same thing and also include all of the matching files in the sub-directories?

Thanks so much!

  • 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-06-08T15:06:54+00:00Added an answer on June 8, 2026 at 3:06 pm

    From the command line you can use

    for /r "c:\javascripts" %F in (*.js) do @type "%F" >>concatenated.js
    

    You might want want to first delete any existing concatenated.js before you run the above command.

    From a batch file the percents need to be doubled

    @echo off
    del concatenated.js
    for /r "c:\javascripts" %%F in (*.js) do type "%%F" >>concatenated.js
    

    EDIT
    It is a bit more efficient to put parentheses around the entire statement and use a single overwrite redirection instead of append redirection with each iteration. It also eliminates the need to delete the file in the beginning.

    >concat.js (for /r "c:\javascripts" %F in (*.js) do @type "%F")
    

    or from batch

    @echo off
    >concat.js (for /r "c:\javascripts" %%F in (*.js) do type "%%F")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of js files I concatenate into a unique file at
I'm just now learning about file tasks in Rake. I have 100s of javascript
I have about 80000 files which I am trying to concatenate. This one: cat
I have a SortedDictionary<string,List<byte[]>> I need to concatenate all the byte[] arrays starting from
I have a some xml fields i need to concatenate all the fields in
I have a tab delimited file, for which I need to concatenate selective columns
I need to concatenate some relatively large text files, and would prefer to do
I have a situation where I need to concatenate several string to form an
I need help to concatenate 2 vars into 1 var, or any other method
I have a file that describes input data, which is split into several other

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.