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,004 of 68,980   
   Kerr-Mudd, John to not.my.real@email.address   
   Re: Bulk copy with changed extension   
   20 Feb 23 20:39:06   
   
   From: admin@127.0.0.1   
      
   On Mon, 20 Feb 2023 19:22:51 -0000 (UTC)   
   "Auric__"  wrote:   
      
   > 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.   
      
   I thought /Y suppressed prompts? It does here (WinXP).   
      
   > Also also, it'll bitch if any subdirectory doesn't actually contain any   
   > files ending in .ino -- safe to ignore.   
   >   
      
      
   --   
   Bah, and indeed Humbug.   
      
   --- 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