If your users have the option to type a directory where they wantfiles installed, they may type a directory that doesn’t existor a directory that is several levels below another directory.
This procedure checks to see if the directory exists and createsit if it doesn’t. No matter how long the request, it will createany and all directories. This procedure allows users to createlong directory names in VB4, but truncates each directory to 8.3characters in VB3. The only requirements are that sDrive be passedas “
Here is an example of creating a directory several levels deepand using a long directory name:
Sub CreateLongDir(sDrive As String, _ sDir As String) Dim sBuild As String While InStr(2, sDir, "") > 1 sBuild = sBuild & Left$(sDir, _ InStr(2, sDir, "") - 1) sDir = Mid$(sDir, InStr(2, _ sDir, "")) If Dir$(sDrive & sBuild, 16) = _ "" Then MkDir sDrive & sBuild End If WendEnd SubSub Test() Call CreateLongDir("C:", _ "TestTestDirLong Directory _ Name")End Sub