Re: Relative path to absolute
From: Steven Burn (nobody_at_PVT_it-mate.co.uk)
Date: 04/02/04
- Next message: Ann: "CreateProcessWithLogonW"
- Previous message: Need Help Quick: "Re: Need HELP QUICK!"
- In reply to: Mike Kanski: "Relative path to absolute"
- Next in thread: Bob O`Bob: "Re: Relative path to absolute"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 2 Apr 2004 18:12:35 +0100
If blah.exe is in the same folder as your app, why not just use App.Path?
i.e. App.Path & "\blah.exe"
You can use the following to strip the filename;
Function StripName(name As String) As String
Dim path As Variant
path = Split(name, "\")
StripName = path(UBound(path))
End Function
And the following to strip the path;
Function Strippath(sFileName As String)
Dim intPos As Integer
intPos = InStrRev(sFileName, "\")
If intPos = 0 Then
Exit Function
Else
Strippath = Left$(sFileName, intPos)
End If
End Function
-- Regards Steven Burn Ur I.T. Mate Group www.it-mate.co.uk Keeping it FREE! Disclaimer: I know I'm probably wrong, I just like taking part ;o) Mike Kanski <mkanski@asi-solutions.com> wrote in message news:upnLpTNGEHA.1396@TK2MSFTNGP11.phx.gbl... > Is there an easy way to convert relative path to the absolute? > > I have a VB application that reads INI file for all the objects that it > needs to run. > INI file example: > > [Run] > RunBlah=../../Blah.exe > > The app knows the base address: > c:\programs\company\myapp\ > > Now i need to read the RunBlah entry and run: > c:\programs\blah.exe > > Is there an easy way or maybe a function i can call to get the absolute > path? > > i.e. > Function GetAbsolutePath(BasePath,RelativePath) as string > ... > returns absolute path > end function > > >
- Next message: Ann: "CreateProcessWithLogonW"
- Previous message: Need Help Quick: "Re: Need HELP QUICK!"
- In reply to: Mike Kanski: "Relative path to absolute"
- Next in thread: Bob O`Bob: "Re: Relative path to absolute"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|