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,003 of 68,980   
   Auric__ to Terry Pinnell   
   Re: Bulk copy with changed extension   
   20 Feb 23 19:22:51   
   
   From: not.my.real@email.address   
      
   Terry Pinnell wrote:   
      
   > I have several hundred text files with the extension '.ino'. On my Win   
   > 10 PC I can view them in any text editor. They are also accessible on my   
   > iPad because they are in subfolders of my Dropbox folder. However they   
   > cannot be viewed directly on the iPad. One of many frustrations I have   
   > with either iOS or Dropbox - haven't quite pinned the culprit down in   
   > this case.   
      
   Pretty sure it's iOS.   
      
   > Could some kind expert please suggest a batch file that would take a   
   > parent folder (File Explorer) path as its input, and make identically   
   > named copies of every .ino file in every subfolder of it, but with a   
   > .txt extension, saving them in the same location.   
   [snip]   
   > If this was a one-off task I would tackle it within File Explorer. I did   
   > so a year ago and it was tedious. But I will want to update it at   
   > intervals, hence the need for some neat automation please.   
   >   
   > Any help would be much appreciated.   
      
   30 seconds of hacking:   
      
     if "%%1=" goto :end   
     cd /D "%%1"   
     copy /Y *.ino *.txt   
     for /d /r %%a in (*) do (   
     cd "%%a"   
     copy /Y *.ino *.txt )   
      
   Note that this *requires* you to tell it what directory to start in. You   
   could automate that using various methods. (I'm not certain, but I don't   
   *think* you can just drag a folder onto the batch. I couldn't in 5 seconds   
   of testing.)   
      
   Also, this will prompt you to overwrite any existing .txt files with the   
   same name, and will stop until you answer. To overwrite without prompting,   
   remove "/Y" from the "copy" line.   
      
   Also also, it'll bitch if any subdirectory doesn't actually contain any   
   files ending in .ino -- safe to ignore.   
      
   --   
   - Warning, system overload.   
     - I know!   
   - Warning, system overload.   
     - I KNOW! But it must be done!   
      
   --- 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