Solved find string within characters

Microsoft Sql server 2005 developer edit...
July 27, 2011 at 16:25:33
Specs: Windows Server 2003, 8GB
I am using a batch file within a program that passes special variables to the batch file.
I want to use one of these variables to rename a file but I only want part of that variable.
Variable passed to batch file from program:
I want to rename a report that the program outputs:
ren \\%COMPUTERNAME%\ITE2\reports\%USER%\
I would like to know how I can get the string between the last \ and .txt and set it to SUBSTR
The length of the name of the txt file is almost always different.

Thanx in advance for any help you can provide...:)

See More: find string within characters

Report •

July 28, 2011 at 06:11:02
✔ Best Answer
So you're looking for the name portion file?
for %%a in ("%BCH_NME%") do @echo %%~Na

How To Ask Questions The Smart Way

Report •

July 28, 2011 at 14:23:27
Worked perfectly.

Report •
Related Solutions

Ask Question