I agree with Lord Orwell, if you can't use long filenames use the short 8.3 version of it. Here's some code that will help you getting the 8.3 path:
vb Code:
  1. Private Declare Function GetShortPathName Lib "kernel32.dll" Alias "GetShortPathNameA" ( _
  2.     ByVal lpszLongPath As String, _
  3.     ByVal lpszShortPath As String, _
  4.     ByVal cchBuffer As Long _
  5. ) As Long
  6.  
  7. Public Function ShortPath(ByVal sLongPath As String) As String
  8.     Const MAX_PATH As Long = 260&
  9.     Dim sShortPath As String
  10.     Dim nLen As Long
  11.    
  12.     sShortPath = String(MAX_PATH, vbNullChar)
  13.     nLen = GetShortPathName(sLongPath, sShortPath, MAX_PATH)
  14.     ShortPath = Left(sShortPath, nLen)
  15. End Function