Anyone remember batch file programming in DOS?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RayVega
    Confirmed User
    • Jul 2004
    • 4212

    #1

    Anyone remember batch file programming in DOS?

    Anyone here remember how to write a DOS batch file? need to run a dos app like this

    executable input file output file
    program.exe oldsong0001from_PS new_track01.mp3

    I have over 80 tracks and would love to run a single batch to grab all .adx's in the directory and convert them to a numbered mp3 fil. So i dont have to type em individual.

    Just cannot dig up the little folder in my brain that remembers dos commands or batch files...aaaaaarghhh
    Ray "The Don" Vega

    Managing Director
    Private Equity Fund

    [email protected]
  • Fred Quimby
    Confirmed User
    • Jul 2004
    • 5430

    #2
    10 print "Fred Quimby"
    20 goto 10

    Comment

    • ChrisAnubis
      Confirmed User
      • Aug 2005
      • 1263

      #3
      Originally posted by Fred Quimby
      10 print "Fred Quimby"
      20 goto 10
      Nice Fred, except that is BASIC, not batch programming.

      For your batch programming, you would need to know if the actual program can run command line parameters, and if it would allow batch to continue running. I am not sure about the renaming of your files, would have to be built into the program I believe, since batch basically (Hey Look Fred-BASIC) runs dos commands and command line program functions.

      I MAY be mistaken though. I never said I was a programming expert.
      I'm still making money with Mayor's Money, Pimproll & jaYMan Cash . Thunder-Ball.net - Member
      ICQ:276-917-507

      Comment

      • sfera
        Confirmed User
        • Aug 2005
        • 8597

        #4
        i remember it, ppl still use them now and then

        Comment

        • BillPMB
          Confirmed User
          • Nov 2002
          • 147

          #5
          Something like this might work.

          @echo off
          ren *.adx *.mp3
          set Count=0
          dir /b | findstr "[0-9][0-9].mp3" > tmp1.txt
          sort tmp1.txt /+5 > tmp2.txt
          for /f %%a in (tmp2.txt) do (call :incr
          call :ReNumber %%a %%Count%%)
          erase tmp?.txt *.tmp
          exit /b
          :incr
          set /a Count=%Count%+1
          goto :eof
          :ReNumber %1 %2
          if exist %1 (echo renamed %1 Old%2.mp3
          ren %1 %1.tmp
          ren %1.tmp Old%2.mp3) else (echo renamed %1 Old%2.mp3
          ren %1 Old%2.mp3)
          goto :eof

          You may have to do some tweaking, but that'll get you close.

          PornMegabucks

          Comment

          • mikeyddddd
            Viva la vulva!
            • Mar 2003
            • 16557

            #6
            Something like this:

            create the process bat file

            program.exe %%x.adx %%x.mp3

            Run this command for each folder

            lfnfor off
            for %%x in (drive:\folder\*.adx) do call process.bat %%x

            It's been awhile

            And you got another answer while I replied
            Last edited by mikeyddddd; 12-20-2005, 06:47 PM.

            Comment

            • sickbeatz
              The Hustler
              • Feb 2005
              • 4993

              #7
              program.exe < input file > output file

              GalleryFeeder.com

              Comment

              • sickbeatz
                The Hustler
                • Feb 2005
                • 4993

                #8
                Originally posted by sickbeatz
                program.exe < input file > output file
                nevermind i thought you trying to do I/O from STDOUT/STDIN

                GalleryFeeder.com

                Comment

                • Fred Quimby
                  Confirmed User
                  • Jul 2004
                  • 5430

                  #9
                  Originally posted by ChrisAnubis
                  Nice Fred, except that is BASIC, not batch programming.

                  For your batch programming, you would need to know if the actual program can run command line parameters, and if it would allow batch to continue running. I am not sure about the renaming of your files, would have to be built into the program I believe, since batch basically (Hey Look Fred-BASIC) runs dos commands and command line program functions.

                  I MAY be mistaken though. I never said I was a programming expert.
                  Do you want the fast way or the right way?





                  thats what my dad always told me

                  Comment

                  • Fred Quimby
                    Confirmed User
                    • Jul 2004
                    • 5430

                    #10
                    I usually chose the fast way

                    Comment

                    • reed_4
                      Confirmed User
                      • Jul 2005
                      • 9640

                      #11
                      Damn, I forgot those DOS commands.

                      Comment

                      Working...