udfPathSkipRoot
str udfPathSkipRoot (str, int)
;----------------------------------------------------------------------------------------------------------------------
#DefineFunction udfPathSkipRoot (strPath)
If strPath == "" Then Return ""
objFSO = ObjectCreate ("Scripting.FileSystemObject")
intLen = StrLen (objFSO.GetDriveName(strPath)) ; Returns a string containing the name of the drive for a specified path.
If intLen > 0 Then strPath = StrSub (strPath, intLen + 1, -1) ; Remove DriveName from the path.
If StrScan (strPath, "\/", 1, @FWDSCAN) == 1 Then strPath = StrSub (strPath, 2, -1)
Return strPath
;......................................................................................................................
; Examples:
; "//SERVER/SHARE/FOLDER/FILE.EXT" ==> "FOLDER/FILE.EXT""
; "D:\FOLDER\FILE.EXT" ==> "FOLDER\FILE.EXT""
; "\FOLDER\FILE.EXT" ==> "FOLDER\FILE.EXT""
;
; Detlev Dalitz.20081024.
;......................................................................................................................
#EndFunction
;----------------------------------------------------------------------------------------------------------------------


; Test.

DirChange (DirScript ())

strFileThis = IntControl (1004, 0, 0, 0, 0)  ; "Z:\WBT\Scripts\udfPathSkipRoot.wbt"

strFilePath = udfPathSkipRoot (strFileThis)  ; "WBT\Scripts\udfPathSkipRoot.wbt"

Exit