Function CreateFolderOnWindows(InputFolder As String, Debug As Integer) On Error 76 Goto CreateFolder Dim tempFolder As String Dim delim As String Dim CheckFolder As String delim = "\" ret = Split(InputFolder, delim) Forall x In ret If Instr(1,x,":") => 1 Then ' this is a drivename If debug = 1 Then Print "Drive: "+ x End If tempFolder = x + "\" Else ' this is a folder If debug = 1 Then Print "Folder: "+ x End If tempFolder = tempFolder + x + "\" CheckFolder = Dir(tempFolder,16) '^^^ check if folder exist. If it doesn´t we get a error 76 and we will create the folder End If End Forall Goto ENDE CreateFolder: Mkdir(tempFolder) Resume Next ENDE: End Function