#1 16. August 2005 hallo, will in visual basic ein kleinen programm coden, das eigene dirs erstellt. und da hab ich mal eine frage wie ich das mache. hoff ihr könnt mir helfen.... + Multi-Zitat Zitieren
#3 17. August 2005 Code: Public Function MakePath(ByVal sPath As String, _ Optional ByVal ShowMsg As Variant) As Boolean Dim antwort As Integer Dim Dummy As String If IsMissing(ShowMsg) Then ShowMsg = False antwort = 0: Err = 0 Dummy = "" On Local Error Resume Next While Len(sPath) > 0 And antwort = 0 If Left$(sPath, 2) = "\\" Then Dummy = Dummy + "\\" sPath = Mid$(sPath, 3) ElseIf left$(sPath, 1) = "\" Then Dummy = Dummy + "\" sPath = Mid$(sPath, 2) ElseIf Mid$(sPath, 2, 2) = ":\" Then Dummy = Dummy + left$(sPath, 3) sPath = Mid$(sPath, 4) End If While left$(sPath, 1) <> "\" And Len(sPath) > 0 Dummy = Dummy + left$(sPath, 1) sPath = Mid$(sPath, 2) Wend Err = 0 MkDir Dummy If Err <> 75 And Err <> 0 Then If ShowMsg Then antwort = MsgBox("Fehler beim Erstellen " & _ "des Verzeichnisses!" + vbCrLf + 48, "Fehler") Else antwort = 1 End If End If Wend On Local Error GoTo 0 MakePath = (antwort = 0) End Function Code: MakePath "c:\test\test2\test3\test4" Sowas? + Multi-Zitat Zitieren