home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 40,643 of 42,547   
   foxidrive to Yela   
   Re: HELP WITH A BATCH FILE   
   18 May 13 15:26:59   
   
   From: not@this.address.invalid   
      
   On 18/05/2013 15:07, Yela wrote:   
   > Hello,   
   >   
   > I am trying to make a batch file that contains a sequence of commands In a   
   directory containing media files with .raw extension and a MS-DOS .exe   
   function, the sequence should do the following:   
   >   
   > 1- Create a folder with just the name of each raw file (no extension)   
   > 2- Move the files to its corresponding folder   
   > 3- Copy the .exe file to each folder   
   > 4- Execute command line"XXXX.exe XXXX.raw" in every folder   
   > 5- Do this with every media file   
   >   
   > The reason it's important to create the folders first is becuase the .exe   
   function splits the media files into frames and they need to be grouped in   
   individual folders to be edited later, right now I am doing this manually and   
   it takes forever.   
   >   
   > Any help would be really appretiated.   
   >   
      
   This should do it.  Test it on some sample files.   
      
   The line with file.exe needs to be changed to the exe filename, and it should   
   work without copying it   
   into every folder (just to save a small amount of space and to be a bit   
   cleaner) by using the command you   
   see below.   
      
   Name the batch file as raw2file.bat and launch it in the folder with all the   
   .RAW files.   
      
   It processes each folder sequentially as it moves the files into a separate   
   folder.   
      
      
   @echo off   
   for %%a in (*.raw) do (   
   md "%%~na" 2>nul   
   move "%%a" "%%~na" >nul   
   pushd "%%~na"   
   ..\"file.exe" "%%a"   
   popd   
   )   
      
      
      
      
      
   --   
   foxi   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca