Hello everyone,
I have got following folder structure:
FuncLib
ObjReb
Temp
TestData
TestSuite
I am using QTP/UFT Test-automation its (vb.net)
with following command I get current folderpath:
result:
C:\XXX_xxxxx_xxxx-xx-xx\TestSuite\Maincase
now I need to get to the root folder in
C:\XXX_xxxxx_xxxx-xx-xx
since all the folders have different length of the name I found it little bit difficult.
I am not able to use len / left.
I tried with mid and instrrev
then I get following result:
C:\XXX_xxxxx_xxxx-xx-xx\TestSuite\Maincase
regardless how many -1 I put nothing changes.
Could someone help me out?
Thank you in advance
I have got following folder structure:
FuncLib
ObjReb
Temp
TestData
TestSuite
I am using QTP/UFT Test-automation its (vb.net)
with following command I get current folderpath:
Code:
TestPath =Environment("TestDir")]
result:
C:\XXX_xxxxx_xxxx-xx-xx\TestSuite\Maincase
now I need to get to the root folder in
C:\XXX_xxxxx_xxxx-xx-xx
since all the folders have different length of the name I found it little bit difficult.
I am not able to use len / left.
I tried with mid and instrrev
Code:
Environment.value("TestPath") =Mid(TestPath,1,Instrrev(Mid(TestPath,1,instrrev(TestPath,"\")-1),"\"))
then I get following result:
C:\XXX_xxxxx_xxxx-xx-xx\TestSuite\Maincase
regardless how many -1 I put nothing changes.
Could someone help me out?
Thank you in advance