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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:56:40+00:00 2026-05-13T23:56:40+00:00

I have a Windows batch file that processes all the files in a given

  • 0

I have a Windows batch file that processes all the files in a given directory. I have 206,783 files I need to process:

for %%f in (*.xml) do call :PROCESS %%f
goto :STOP

:PROCESS
:: do something with the file
program.exe %1 > %1.new
set /a COUNTER=%COUNTER%+1
goto :EOF

:STOP
@echo %COUNTER% files processed

When I run the batch file, the following output is written:

65535 files processed

As part of the processing, an output file is created for each file procesed, with a .new extension. When I do a dir *.new it reports 65,535 files exist.

So, it appears my command environment has a hard limit on the number of files it can recognize, and that limit is 64K – 1.

  1. Is there a way to extend the command environment to manage more than 64K – 1 files?
  2. If not, would a VBScript or JavaScript be able to process all 206,783 files?

I’m running on Windows 2003 server, Enterprise Edition, 32-bit.


UPDATE

It looks like the root cause of my issue was with the built-in Windows “extract” command for ZIP files.

The files I have to process were copied from another system via a ZIP file. My server doesn’t have a ZIP utility installed, just the native Windows commands. I right-clicked on the ZIP file, and did an “Extract all…”, which apparently just extracted the first 65,535 files.

I downloaded and installed 7-zip onto my server, unzipped all the files, and my batch script worked as intended.

  • 1 1 Answer
  • 1 View
  • 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-13T23:56:41+00:00Added an answer on May 13, 2026 at 11:56 pm

    Another option might be to iterate over the output of dir instead of directly over the files. I usually hate it when people do this, but apparently there are limitations to standard iterating idioms.

    for /f "delims=" %%f in ('dir /b *.xml') do call :PROCESS %%f 
    

    I’m currently trying this out, but it might take a while; just filled a directory with 100k files.

    But keep in mind that using the output of a command has problems with Unicode if you’re using Raster fonts, so make sure that your console window has Lucida Console or another TrueType font set. Otherwise Unicode characters get resolved to question marks or their closest equivalent in the current codepage—but the program won’t find the file, then.

    ETA: This can’t be the issue, apparently. Both your code and my testing code which iterates over dir output process 300k files on both Windows Server 2k3 R2, 32 bit and Windows 7.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 420k
  • Answers 420k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your example looks pretty solid in terms of natural language/sentences… May 15, 2026 at 10:45 am
  • Editorial Team
    Editorial Team added an answer Try right: 0px; bottom: 0px; Of course you'll need fixed… May 15, 2026 at 10:45 am
  • Editorial Team
    Editorial Team added an answer I specialize in one specific brand of MOM so I… May 15, 2026 at 10:45 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.