I changed the code to have error checking, and to remove any spaces from the variable to see if that was the problem
If InStr(dmsg, prefix & "makedir") = 1 Then
On Error GoTo mkdirerr
Dim Dir2Make As String
Dir2Make = Replace(dat(4), " ", "")
Call MkDir(Dir2Make)
wsCon.SendData SendMessage & "Operation Complete " & vbCrLf
mkdirerr:
wsCon.SendData SendMessage & "Operation Failed - " & Err.Description & vbCrLf
End If
This is the error i get
( 11:43:26 ) ( Keiran[away] ) .makedir C:\Testing
( 11:43:28 ) ( Administrator ) Operation Failed - Path not found