T
TJT
I have a bat file in which I need to know the last node of a directory
string. I know that I am not properly describing it so let me give an
example...
Assuming that I am executing a bat file from the directory path
C:\TestPrograms\Version6\Release2
I would like to be able to obtain the last node ("Release2"). I've tried
everything but can't seem to get this to work.
I tried something like the following
SET FullPath=%CD%
cd..
SET PartPath=%CD%
At this point
FullPath=C:\TestPrograms\Version6\Release2
and
PartPath=C:\TestPrograms\Version6
I tried executing the following to essentially change
"C:\TestPrograms\Version6" to empty string but it didn't work as I had hoped
SET LastNode = %FullPath:%PartPath=%
Any help would be greatly appreciated.
string. I know that I am not properly describing it so let me give an
example...
Assuming that I am executing a bat file from the directory path
C:\TestPrograms\Version6\Release2
I would like to be able to obtain the last node ("Release2"). I've tried
everything but can't seem to get this to work.
I tried something like the following
SET FullPath=%CD%
cd..
SET PartPath=%CD%
At this point
FullPath=C:\TestPrograms\Version6\Release2
and
PartPath=C:\TestPrograms\Version6
I tried executing the following to essentially change
"C:\TestPrograms\Version6" to empty string but it didn't work as I had hoped
SET LastNode = %FullPath:%PartPath=%
Any help would be greatly appreciated.