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,662 of 42,547   
   rafflenbeul to All   
   Re: Problems with renaiming   
   19 Aug 18 21:30:01   
   
   From: daniel-r@gmx.net   
      
   I `ll get it with but theres again one error...   
      
   @echo off   
   set string=%1   
   set romo=%2   
   set string=%string:"=%   
   set romo=%romo:"=%   
   ren "%string%%romo%.MP3"  "%string%%romo%.p3"   
   ren "%string%%romo%.p3"  "%string%%romo%.mp3"   
   exit   
      
      
      
   rename would NOT work here with drive letters bevor..   
   If i take   
      
   ren datei.1 datei.2 it works but   
   ren c:\datei.1 to c:\datei 2 it would NOT work   
   so i try this :   
      
   @echo off   
   set string=%1   
   set romo=%2   
   set string=%string:"=%   
   set romo=%romo:"=%   
      
      
      
   cd %string%   
   ren "%romo%.MP3"  "%romo%.p3"   
   ren "%romo%.p3"  "%romo%.mp3"   
      
      
   on the same drive it works on a other driva again not ??!!!   
      
      
      
      
      
   Am 19.08.2018 um 20:58 schrieb Grant Taylor:   
    > On 08/19/2018 06:25 AM, rafflenbeul wrote:   
    >> Hy to all..   
    >   
    > Hi,   
    >   
    >> I ve got the following Problem..   
    >>   
    >> Some of my mp3 Files are written like   
    >>   
    >> gdgfdgfg.MP3   
    >>   
    >> I would like to renae it to   
    >>   
    >> gdgfdgfg.mp3   
    >>   
    >> with normal ren .MP3 to mp3 it would not work.   
    >>   
    >> so i`ll try ren .MP3 to p3 and ren p3 to mp3 ... that will work...   
    >   
    > Sure.   
    >   
    > I suspect you could move do the following too:   
    >   
    >     move gdgfdgfg.MP3 temp\gdgfdgfg.mp3   
    >     move temp\gdgfdgfg.mp3 gdgfdgfg.mp3   
    >   
    > I'm guessing that gdgfdgfg.MP3 and gdgfdgfg.mp3 are effectively the same   
    > file.   
    >   
    >> as parameters for my Batch i get :   
    >   
    > How is your batch file being called?   
    >   
    >> "path-of-file-with\"empty"filename-without-ext".MP3   
    >   
    > I'm not sure I'm tracking what you are saying there?   
    >   
    > Is "empty" a representation for white space in the file name?  Or is it   
    > a parameter separation?   
    >   
    >> i would likt to get the following and hope you can help me :   
    >>   
    >> ren path-of-file-with\filename-without-ext.MP3   
    >   
    > Do you want the (path+)filename-without-extension to be the argument to   
    > the batch?  Or do you want the batch to receive   
    > (path+)filename-with-extension and do the proper conversions for you? (I   
    > would think the latter.)   
    >   
    >> without the quotation marks around the parameters and without the   
    >> spaces between the both parameters and the ending.   
    >   
    > The quotation marks around the parameters makes sense and (I think) is   
    > an artifact of being able to handle parameters with white spaces in them.   
    >   
    > I'm not sure what you mean by "both parameters" or "and the ending".   
    >   
    >> Is there any batchoption with ltrim or right$ or anything else ??   
    >   
    > Which batch environment are you running in?   
    >   
    > Seeing as how you're talking about spaces and quoting parameters, I'm   
    > guessing it's not classic MS-DOS (et al).   
    >   
    > It's been a REALLY LONG TIME since I've used this, but I seem to recall   
    > that for had options to specify files names with(out) path and / or   
    > extensions.  So you'd do something like this:   
    >   
    >     for %f in (path\gdgfdgfg.MP3) do   
    >        rem something   
    >   
    > Where the parameters to for tell it that you want it to strip the   
    > extension and / or the path.  You might have to do each in separate   
   steps.   
    >   
    > I think that you'd rather have the wrong extension passed to the batch   
    > file, instead of assuming that it's ".MP3", so that it could work with   
    > other extensions too.   
    >   
    > For might even have an option to simply change the case of what's passed   
    > to it.  Thus enabling you to make your batch even more extension   
   agnostic.   
    >   
    >   
    >   
      
   --- 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