FG
💻 Software

Run a batch command for every file in a directory

Fresh5 days ago
Mar 15, 202619946 views
Confidence Score0%
0%

Problem

I have a Java program working with this syntax: I have to run this program for 1600 files in a directory. How can I run this command for every file automatically? Is there a DOS batch command? Or another way?

Error Output

command.jar namefile

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Run a batch command for every file in a directory

Low Risk

The easiest way is by far to simply run a loop over all the files. The good thing is that the (the input for the -loop) does accept the same wildcards like the regular . For use in a batch file: For use from the command line:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment