
? How do you change a path to a dos path name
Steve -
The File object in the Scripting Runtime provides a "ShortPath"
function that returns an MS-DOS path... Here's a quick sample: (Don't
forget to set a reference to the Microsoft Scripting Runtime)
Dim objFSO As Scripting.FileSystemObject
Dim objFil As File
Dim strFileName as String
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFil = objFSO.GetFile("C:\long folder name\long file name.ext")
strFileName = objFil.ShortPath
Hope this helps...
- Rick
===============
Quote:
> Hi I've come accross this before but can't remember were, If I
> remember the function are routine would take for example
> "c:\program files\etc"
> and give somthing like this back
> "c:\program ~\etc"
> Woud anyone know the routine
> Thanks
> Steve