|
Answer» Hi all, i am looking for some HELP please
Basicly i have a program lets call it program.exe that doesn't support wildcards what i want is a batch file to find say *.EXT in a folder and run the command on the found file, go back check again for anymore and process if necessary.
this sound so simple i cannot seam to work it out.
you want to run all .exe in folder ?i have a folder called somefolder in this folder are some FILES called aaaaaa.aaa aaaaaa.bbb aaaaaa.ccc bbbbbb.aaa bbbbbb.bbb cccccc.aaa etc
i have a program called prog.exe
i want to process all the *.aaa files
this works for a SINGLE file
Code: [Select]cd work ..\tools\prog.exe aaaaaa.aaa exit this won't work on multiple files
Code: [Select]cd work ..\tools\prog.exe *.aaa exit the prog.exe does not support wildcards the prefix to the filename changes every time the batch is called the extension is always the same the folders are always the same all you need is the for loop.can you post an example code that would work pleaseCode: [Select]@ECHO off for /f %%a in ('dir /b *.aaa') do prog.exe %%a pauseCode: [Select]@echo off for /f "tokens=" %%A in ( ' dir /b *.aaa ' ) do ( echo Processing file %%A start /WAIT "" "Path to\prog.exe" "%%A" ) @for /r somefolder %%a in (*.aaa) do @prog "%%a"Thanks for all the fast replys and help got it working now
|