extracting file name from an environment variiable
Posted: 12 Oct 2009 17:03
I know that you can parse complete file path names easily when expanding batch file parameters.
For example, you may execute the following command line:
PROCESS.BAT C:WINDOWS\NOTEPAD.EXE
where process.bat contains the following line:
@ECHO %~NX1
The results would be:
NOTEPAD.EXE
But is there a way to easily parse environment variables in a siimilar way? or a way to convert the environment variable into a parameter so I may use these file name parsing functions on it?
For example, you may execute the following command line:
PROCESS.BAT C:WINDOWS\NOTEPAD.EXE
where process.bat contains the following line:
@ECHO %~NX1
The results would be:
NOTEPAD.EXE
But is there a way to easily parse environment variables in a siimilar way? or a way to convert the environment variable into a parameter so I may use these file name parsing functions on it?