;; 
;;=====================================================================================----- 
;; 
;;FUNCTION       MDPath() 
;; 
;;ACTION         Creates a directory path on local or remote system 
;; 
;;AUTHOR         Glenn Barnas  
;; 
;;VERSION        1.0  - 2002/08/18 
;; 
;;HISTORY        1.0  - 2002/08/18 - Initial Release 
;; 
;;SYNTAX         MDPath(Path) 
;; 
;;PARAMETERS     Path - Directory path to create. 
;; 
;;REMARKS        Path can be relative (a\b\c), rooted (\a\b\c), and either type can 
;;               specify either a drive (D:) or UNC name (\\server\share) 
;; 
;;RETURNS        nothing - creates directory path 
;; 
;;DEPENDENCIES   PathSplit() 
;; 
;;TESTED WITH    NT4, W2K, WXP 
;; 
;;EXAMPLES       MDPath("C:\Temp\install")            ; creates local dir-path 
;;               MDPath("\\server\c$\Temp\install")   ; creates remote dir-path 
; 
Function MDPath($_Path)
 
  Dim $_DirPath, $_Dir, $_Dirs, $_aPathInfo
 
  ; make sure PathSplit sees it as a Directory 
  If Right($_Path,1) <> "\"
    $_Path = $_Path + "\"
  EndIf
 
  $_aPathInfo = PathSplit($_Path)
  ; If a drive/share is specified, define it as the base path 
  If $_aPathInfo[1] <> ""
    ; set it to Server + Share/Drive - Server will be null if Drive is specified 
    $_DirPath = $_aPathInfo[0] + $_aPathInfo[1]
    ; root the path if necessary 
    If Left($_aPathInfo[2],1) = "\" $_DirPath = $_DirPath + "\" EndIf
  EndIf
 
  ; Element 3 is normally null, except when only one directory is specified 
  ; in an unrooted manner and it contains a "." character - unlikely 
  ;  + $_aPathInfo[3] 
  $_Dirs = Split($_aPathInfo[2], "\")
 
  For Each $_Dir in $_Dirs
    ; don't add null dirs - it doubles the "\" if you do 
    If $_Dir <> ""
      $_DirPath = $_DirPath + $_Dir + "\"
      If Exist($_DirPath) = 0
        MD $_DirPath
      EndIf
    EndIf
  Next
 
EndFunction