from the VB command() statement..
I want to extract out a folder name like this:
I will use this logic to get rid of the rest of path.. but I need to get the
real path name:
right(FilePath, len(filepath) - InstrRev(FilePath, "\") )
It looks like I found my answer at the Microsoft site. This VB routine
seems to work good for me. I read in Applemans book that the API has some
big problems in VB, so this is the best fix..
Function GetLongFN(ByVal sShortName As String) As String
Dim sLongName As String, sTemp As String, iSlashPos As Integer
'Add \ to short name to prevent Instr from failing
sShortName = sShortName & "\"
'Start from 4 to ignore the "[Drive Letter]:\" characters
iSlashPos = InStr(4, sShortName, "\")
'Pull out each string between \ character for conversion
sTemp = Dir(Left$(sShortName, iSlashPos - 1), vbNormal +
vbHidden + vbSystem + vbDirectory)
If sTemp = "" Then 'Error 52 - Bad File Name or
GetLongFN = ""
sLongName = sLongName & "\" & sTemp
iSlashPos = InStr(iSlashPos + 1, sShortName, "\")
'Prefix with the drive letter
GetLongFN = Left$(sShortName, 2) & sLongName