home bbs files messages ]

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

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

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

   Message 68,146 of 68,980   
   Robert Roland to me@somewhere.invalid   
   Re: Copying to SD card sequentially   
   27 Oct 23 14:30:49   
   
   From: fake@ddress.no   
      
   On Fri, 27 Oct 2023 12:38:02 +0100, Terry Pinnell   
    wrote:   
      
   >for /f %i in ('dir   
   >"C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   >SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3 _files\FromL-1" /on   
   >*.mp3') do copy %i L:\   
      
   If you want it all in one line:   
      
   for /f %i in ('dir /on /b   
   "C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3   
   _files\FromL-1\*.mp3"') do copy   
   "C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3 _files\FromL-1\%i" L:\   
      
   The /b matters. It tells the DIR command to output only the file   
   names.   
      
   If you can accept two lines, simply change the current directory (CD   
   command) to the directory that contains the MP3 files first. Then   
   Herbert's solution only needs the destination drive changed (this is   
   two lines):   
      
      
     cd "C:\Users\terry\Dropbox\Electronics\Arduino\SKETCHES\MY   
   SKETCHES\PROJECTS_Arduino\TalkingTemp Proj\_MP3 _files\FromL-1"   
     for /f %i in ('dir /b /on *.mp3') do copy "%i" L:\   
      
   The quotes around the path and %i are only required if the path   
   contains spaces, but it is good practice.   
      
   As mentioned earlier, if you want to put this into a batch file, the   
   percent signs must be doubled.   
   --   
   RoRo   
      
   --- 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