Quick help needed....DOS(?) batch file question...

diamonddrago

Member
Oct 13, 2009
4,865
117
0
In the attic...
I need to create a batch file to pass 586 files of type .ogg through dec.exe for example

dec.exe -Q <file no1>
dec.exe -Q <file no2>
dec.exe -Q <file no3>
dec.exe -Q <file no4>
dec.exe -Q <file no5>

like that pass 586 files....

do you know how to loop in batch files to do this?.....all the files are in one folder....:oo:

i have asked this question everywhere except in EK.....:nerd:
 

sanzilla jackcat

Well-known member
  • Oct 3, 2008
    6,765
    3,357
    113
    ෆ්ලුජා නගරය
    what about writing a simple C++ program.
    it's easy that you think.

    Code:
    #include <iostream>
    #include <string>
    #include <stdio.h>
    
    int main(int argc,char **argv)
    {
     for (int i=0;i<586;i++)
     {
       std::string current_command;
       current_command="";
       current_command="dec.exe -Q <file no";
       current_command+=i;
       current_command+=">";
     
       system(current_command.c_str());
     }
    }
     

    diamonddrago

    Member
    Oct 13, 2009
    4,865
    117
    0
    In the attic...
    what about writing a simple C++ program.
    it's easy that you think.

    Code:
    #include <iostream>
    #include <string>
    #include <stdio.h>
    
    int main(int argc,char **argv)
    {
     for (int i=0;i<586;i++)
     {
       std::string current_command;
       current_command="";
       current_command="dec.exe -Q <file no";
       current_command+=i;
       current_command+=">";
     
       system(current_command.c_str());
     }
    }


    :( :( :(

    i don't have any programming languages on my PC except python....can you run a DOS command-line thru it?....:oo:

    and the files are not in order.....and are very random.....extension is same....
     
    Last edited:

    diamonddrago

    Member
    Oct 13, 2009
    4,865
    117
    0
    In the attic...
    thanx guyz...but i ended up cheating....

    i piped the folder to a text file in command prompt.....dir ouptput actually

    then used replace to add in the code and made a batch file in notepad....:nerd:

    586 files was a bit much....bt i made it...:)

    +rep from me to everyone who helped me out by posting in this thread....