Ital
asked on
vb 6 App.Path
hi
the path of my program is : c:\test\funny\
i do
i got an other folder
c:\test\Magic\Allo.txt
i need to be able to go get that file
with the App.Path
so basacly, what i need is the command to go back one shot. like a CD..
1- be able to go one folder back
thx
Ital
the path of my program is : c:\test\funny\
i do
i got an other folder
c:\test\Magic\Allo.txt
i need to be able to go get that file
with the App.Path
so basacly, what i need is the command to go back one shot. like a CD..
1- be able to go one folder back
thx
Ital
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim MyDataFile As String
MyDataFile = StrReverse(App.Path)
MyDataFile = StrReverse(Right(MyDataFil e, Len(MyDataFile) - InStr(1, MyDataFile, "\"))) & "\Magic\Allo.txt"
MyDataFile = StrReverse(App.Path)
MyDataFile = StrReverse(Right(MyDataFil
'strFolder will contain the path to the folder you want
Dim strFolder As String
Dim x As Integer '
For x = Len(App.Path) To 1 Step -1
If Mid(App.Path, x, 1) = "\" Then
strFolder = Mid(App.Path, 1, Len(App.Path) - (x + 1))
End If
Next x
Dim strFolder As String
Dim x As Integer '
For x = Len(App.Path) To 1 Step -1
If Mid(App.Path, x, 1) = "\" Then
strFolder = Mid(App.Path, 1, Len(App.Path) - (x + 1))
End If
Next x
ASKER
Exactly what i needed
its perfect
thx
its perfect
thx
Private Sub Command1_Click()
Dim arrFile() As String
arrFile = Split("c:\test\Magic\Allo.
If Left(App.Path, 1) <> "\" Then
MsgBox App.Path & "\" & arrFile(UBound(arrFile))
Else
MsgBox App.Path & arrFile(UBound(arrFile))
End If
End Sub