You can convert long file names to short windows filenames (i.e. C:\Progra~1 etc)
Code:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Function ConverLongFileName(pstrFileName As String) As String
Dim strBuffer As String
Dim lRet As Long
strBuffer = Space(255)
lRet = GetShortPathName(pstrFileName, strBuffer, Len(strBuffer))
If lRet = 0 Then
ConverLongFileName = pstrFileName
Else
ConverLongFileName = Left(strBuffer, lRet)
End If
End Function
Usage: ConverLongFileName FileToConvert
Sample:
Dim strFile As String
strFile = ConverLongFileName("C:\WINNT\Media\The Microsoft Sound.wav")
strFile in my case would be: C:\WinNT\Media\THEMIC~1.WAV
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819