|
Answer» I am trying to run a DOS utility that converts all files of a certain type (.PGN files ) to another format so they can be read by another program.
However I want to run this utility on all the files in a directory (about 100 files). Is there a way to write a batch file that would read all the PGN files in a directory and then run the utility on them.Hi, because you don't give much info I can only guess that you have to type something like this into a dos prompt window:
convert mypic.png
Where 'convert' is the command used to change these files
Is this correct? If it is can you replace 'mypic' with an asterisk? ie
convert *.png
Derek.Sort of. I tried what you suggested but Dos reports that it cannot open the file "*.pgn". It seems the DOS utility I want to run does not accept wildcards in filenames.
I thought of creating a batch file listing all the files in a directory with "DIR /b > file.bat", then adding the Dos utility command in front of each line, so that it will run the command on each file. This works as I have tried it out by manually adding the command to each line. But with 200+ LINES in the batch file this is laborious, so I am STUCK with trying to AUTOMATE this part of the process.
I THINK what you might NEED is the FOR command combined with your DIR command.
Check out: http://www.robvanderwoude.com/index.htm
l
|