I am writing a batch file(Say, Primary.bat
) that generates a text file(actually .bat, say Generator.bat
) which collects all the text file names from a particular directory(folder) and writes in generator.bat.
The contains of Primary.bat is now -
Rem Following command will write the names of all files in a text file
dir /b "C:\InputOutput\SourceFiles" > "C:\InputOutput\Generator.bat"
So, the contents of Generator.bat
looks like -
(1) Now I need to add code in the script(Primary.bat) so that all the above lines in Generator.bat
can be changed to the following commands -
converter.java C:\InputOutput\SourceFiles\input1.txt C:\InputOutput\OutFiles\input1.rtg
converter.java C:\InputOutput\SourceFiles\input2.txt C:\InputOutput\OutFiles\input2.rtg
converter.java C:\InputOutput\SourceFiles\input3.txt C:\InputOutput\OutFiles\input3.rtg
converter.java C:\InputOutput\SourceFiles\unitedstates1.txt C:\InputOutput\OutFiles\unitedstates1.rtg
converter.java C:\InputOutput\SourceFiles\unitedkingdomsales.txt C:\InputOutput\OutFiles\unitedkingdomsales.rtg
converter.java C:\InputOutput\SourceFiles\majorregion100.txt C:\InputOutput\OutFiles\majorregion100.rtg
(2) After having task 1 done I want to have Generator.bat some code so that on clicking on Generator.bat it executes all the command lines.
Please help with simple code and simple logic. It would be really good if you test code before before replying. Thanks in advance