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,796 of 42,547   
   Herbert Kleebauer to Lori Fairhead   
   Re: rename files with prefix   
   18 Nov 19 20:08:25   
   
   From: klee@unibwm.de   
      
   On 18.11.2019 18:29, Lori Fairhead wrote:   
      
   >> 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   
      
   Because I never, never use spaces in file names I also don't   
   test it (but at least I added the " which are also only necessary   
   if there are spaces in the file name):   
      
   for /f "tokens=*" %i in ('dir /b') do ren "%i" "VIETNAM-%i"   
      
      
      
   > FOR %i IN (*.MP4) DO REN "%i" "VIETNAM-%i"   
      
   I mostly avoid this version because I once had a problem   
   that already processed names are processed a second time   
   (so you get VIETNAM-VIETNAM-...). But maybe this was only   
   a problem with a FAT file system and long file names where   
   a new entry in the directory had to be generated.   
      
      
   > 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....   
      
   Just type "cmd /?", "for /?" "dir /?" etc.   
      
   Online:   
   https://docs.microsoft.com/en-us/windows-server/administration/w   
   ndows-commands/cmd   
   https://download.microsoft.com/download/5/8/9/58911986-D4AD-4695   
   BF63-F734CD4DF8F2/ws-commands.pdf   
      
   https://blogs.windows.com/windowsdeveloper/2014/10/07/console-im   
   rovements-in-the-windows-10-technical-preview/   
      
   > Nice to see you again Herbie :)   
      
   Didn't even recognize that the posting was from you, just read   
   the body but not the posters name. Does your new (old) Motorola   
   tablet work?   
      
   --- 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