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 41,793 of 42,547   
   Lori Fairhead to Herbert Kleebauer   
   Re: rename files with prefix   
   18 Nov 19 09:29:42   
   
   From: lorif32768@gmail.com   
      
   On Monday, November 18, 2019 at 4:47:08 PM UTC, Herbert Kleebauer wrote:   
   > On 18.11.2019 16:57, Lori Fairhead wrote:   
   > > Hello there,   
   > >   
   > > I am not very familiar with NT BATCH programming yet   
   > > but I had previously assumed that the command:   
   > >   
   > > REN * VIETNAM-*   
   > >   
   > > would rename all files in the current directory to   
   > > include a prefix of VIETNAM-.   
   > >   
   > > It didn't do that, instead it superimposed the prefix   
   > > onto the filename at the beginning,   
   > >   
   > > How would I add a prefix to all the current files   
   > > in the directory?   
   >   
   > At the command promt:   
   >   
   > for /f  %i in ('dir /b') do ren "%i" "VIETNAM-%i"   
   >   
   > in a batch file:   
   >   
   > for /f  %%i in ('dir /b') do ren "%%i" "VIETNAM-%%i"   
      
   This didn't work properly; the FOR loop only put the first word   
   of the file name into the REN %i   
      
   In the end I managed to do it with the following command:   
      
   FOR %i IN (*.MP4) DO REN "%i" "VIETNAM-%i"   
      
   Do you know if there are any books on NT BATCH programming?   
   I learnt most of my MSDOS batch programming from the manual   
   but there doesn't seem to be one for NTDOS. At least briefly   
   searching e-bay doesn't turn up anything....   
      
   Nice to see you again Herbie :)   
      
   Regards,   
   Lori F   
      
   --- 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