? How do you change a path to a dos path name 
Author Message
 ? How do you change a path to a dos path name

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



Sun, 20 Jun 2004 20:11:52 GMT  
 ? How do you change a path to a dos path name

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

Search for GetShortPathName on the vbNet site (www.mvps.org/vbnet)

HTH,
Bryan
____________________________________________________________
New Vision Software            "When the going gets weird,"
Bryan Stafford                   "the weird turn pro."

Microsoft MVP-Visual Basic     Fear and Loathing in LasVegas



Mon, 21 Jun 2004 00:37:29 GMT  
 ? 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



Mon, 21 Jun 2004 03:41:45 GMT  
 ? How do you change a path to a dos path name
Yes that helped thank you
Steve


Mon, 21 Jun 2004 10:22:05 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. App.Path only returning short path name - Why?

2. app.path only returns short path name

3. Long Path Names give Runtime error 76 - Path not found

4. App.Path returns "short" path name

5. Best method of determining path, relative path and/or flie name

6. Parsing an HTML Document - Change Relative paths to fully qualified paths

7. Changing Long Paths to Short Paths in a 16-bit App

8. Getting DOS 8.3 path from Windows long file name

9. DOS Compatiable Path Names

10. Getting a File's Dos Name and Path

11. Dos Path change

12. Changing File name in a path

 

 
Powered by phpBB® Forum Software