Re: Extracting last Folder Name from complete path
From: Tom Lavedas (tlavedas_at_hotmail.remove.com)
Date: 12/02/04
- Next message: Jerold Schulman: "Re: Re: Extracting last Folder Name from complete path"
- Previous message: andreas kässens: "Re: Extracting last Folder Name from complete path"
- In reply to: andreas kässens: "Re: Extracting last Folder Name from complete path"
- Next in thread: Jerold Schulman: "Re: Re: Extracting last Folder Name from complete path"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 2 Dec 2004 05:29:06 -0800
The command processor provides file name parsing directly in the FOR ...
@echo off
set pfad=D:\Arbeit\PROJEKTE\ATARI 2
for %%a in ("%PFAD%") do echo %%~na
Type FOR/? at a command prompt for more info and other parsing options.
Tom Lavedas
===========
"andreas kässens" wrote:
> "Michael Bednarek" wrote
>
> > Using 4NT/4DOS, I do this frequently thus:
> > ECHO %@WORD["\",-0,C:\temp\ExtendedDB]
> >
> > 4NT is a commercial product, 4DOS is free
>
> Thanks a lot for your answer! But I have to use the standard Windows xp
> commands, which do not have such function. So I tried the following batch:
>
> @echo off
> set pfad=D:\Arbeit\PROJEKTE\ATARI 2
> for /f "delims=\ tokens=4" %%a in ("@echo %pfad%") do @echo %%a
>
> Unfortunately there seems to be no way to address the last token in general
> ("tokens=-1" does not work). The only way I can think of, is another for
> loop, which counts the "\" in the variing path and replace it with the
> tokens value.
>
> This seems to be far too much effort for such a simple task, doesn't it?
>
> Andreas
>
>
>
- Next message: Jerold Schulman: "Re: Re: Extracting last Folder Name from complete path"
- Previous message: andreas kässens: "Re: Extracting last Folder Name from complete path"
- In reply to: andreas kässens: "Re: Extracting last Folder Name from complete path"
- Next in thread: Jerold Schulman: "Re: Re: Extracting last Folder Name from complete path"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|