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,533 of 42,547   
   micky to Kleebauer   
   Re: Is there a way to specify part of th   
   25 Feb 17 19:06:27   
   
   XPost: alt.msdos.batch.nt   
   From: NONONOmisc07@bigfoot.com   
      
   In alt.msdos.batch.nt, on Sat, 25 Feb 2017 21:18:47 +0100, Herbert   
   Kleebauer  wrote:   
      
   >On 25.02.2017 20:17, micky wrote:   
   >>   
   >> Is there a a symbolic variable that specifies part of the path?   
   >> Specifically the last node (are they called nodes?).  That is, if it's   
   >> C:\programs\housework\tuesday\ironing.exe  I want to get \tuesday\  with   
   >> or without slashes.   
   >>   
   >> It's not necessarily 8 characters long, or any other predictable length,   
   >> but I could use all the characters after the next-to-last slash, if   
   >> there's a way to do that.   
   >   
   >   
   >@echo off   
   >set a=C:\programs\housework\tuesday\ironing.exe   
   >   
   >for %%i in (%a%)    do set b=%%~dpi   
   >for %%i in (%a%\..) do set c=%%~dpi   
   >call set d=%%b:%c%=\%%   
   >   
   >echo %a%   
   >echo %b%   
   >echo %c%   
   >echo %d%   
      
   I havent' figured out how yet, but that seems to have done it!  Thainks.   
      
   --- 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