Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extract a file name from the full file path

Tags:

vbscript

In VBScript how to separate Test1_QTP folder name alone from the below path. I need to extract "Test1_QTP" string into a variable.

C:\TeamTask\Automation\Daily\EB\20140508\Test1_QTP

Any suggestions are appreciated.

like image 529
MSN Avatar asked Feb 13 '23 00:02

MSN


1 Answers

Dim strMyPath, strFileName
strMyPath = "C:\TeamTask\Automation\Daily\EB\20140508\Test1_QTP"
strFileName = Mid(strMyPath, InStrRev(strMyPath, "\") + 1)
like image 132
rory.ap Avatar answered Feb 23 '23 16:02

rory.ap