DOS format

simian

Member
Joined
Jun 7, 2006
Messages
13
Programming Experience
Beginner
I was wondering if there is a way to reformat a directory string ie "c:\My Documents\User" to the old dos format ???
Thanks
 
E.g.
VB.NET:
Private Declare Ansi Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
                                                                                         ByVal lpszShortPath As String, _
                                                                                         ByVal cchBuffer As Integer) As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Const MAX_LENGTH As Integer = 260
    Dim longPath As String = Application.ExecutablePath
    Dim shortPath As String = New String(" "c, MAX_LENGTH)
    Dim length As Integer = GetShortPathName(longPath, shortPath, MAX_LENGTH)

    MessageBox.Show(shortPath)
End Sub
 
you cant just reformat a directory to a different FS, you can reformat a hard drive partition to another format, but that would erase everything on that partition
 
Back
Top