Pass all files in directory that match criteria to a program -
Pass all files in directory that match criteria to a program -
in windows explorer when drag , drop 100 files on batch file, error saying "data area passed scheme phone call small"
i generated batch file take 100 arguments so, thinking work
myprog.exe %1 %2 %3 %4 %5 ... %100
myprog takes bunch of paths , things them.
so solution is
for %%x in (*.my_ext) ( myprog.exe %%x )
but initializing programme 1 time again , 1 time again since passing 1 file it, sort of defeats purpose of accepting arbitrary number of arguments , start-up + finish slowing things down.
ideally, pass files programme , allow run. how accomplish this?
edit:
one thought i'm going one: how can concatenate strings in windows batch file?
my solution looks this. have 2 batch files get_files.bat
, main.bat
get_files.bat
@echo off set myvar=myprog.exe /r %%i in (*.my_ext) phone call :concat "%%i" echo %myvar% goto :eof :concat set myvar=%myvar% %1 goto :eof
main.bat
call get_files.bat > out.bat phone call out.bat
i first create command want call, , phone call it. allows me pass 100's of paths match given crieria program, though seems @ point reach limit on how long input string can be.
the ideal solution building long of list possible , passing list program, , repeat until files have been processed. files may searched recursively, etc.
microsoft has published back upwards article command prompt (cmd. exe) command-line string limitation.
on computers running microsoft windows xp or later, maximum length of string can utilize @ command prompt 8191 characters. on computers running microsoft windows 2000 or windows nt 4.0, maximum length of string can utilize @ command prompt 2047 characters.
the best method avoid limitation on executing application many files utilize list file suggested andriy m.
for illustration winrar interprets file name starting @
name of list file containing line line names of files compress/extract.
the text editor ultraedit supports command line alternative /f"name of list file"
open files listed line line in specified list file.
and file manager total commander supports %l, %l, %f, %f, %d, %d, %wl, %wf, %ul, %uf
in command line application called total commander. 1 of placeholders present, total commander creates in directory temporary files list file names of selected files written line line, before starts application name of list file. total commander supervises started application , deletes list file after application terminated.
i think, in case best application deletes list file after processing files listed in file line line.
batch-file
Comments
Post a Comment