Richard beat me there! -
Basically this over-complicated snippet should give you an idea of how to break the string down. Also look in the docs at functions like Instr(), Substr(), Len(), Right() and Left().
code:
$string = "\\server1\etc\whatever\james.doc" ;or whatever
? ? "Starting string is: " + $string
$x = instr($string,"\\")
if $x
$string = substr($string,$x+2,len($string)-2) ;chop off first two backslashes
endif
? ? "Remove \\ from string: " + $string
$x = instr($string,"\") ;find the end of the server name
if $x
$servername = substr($string,1,$x-1) ;Read from the beginning of the string to the next \
$path = substr($string,$x,len($string)) ;Read from the first \ to the end of the string
endif
? ? "Server name from string is: " + $servername
$servername = "\\" + $servername
? ? "Replace \\ to prefix server name: " + $servername
? ? "Remainder of path from original string: " + $path
:end
Exit
HTH
_________________________
================================================
Breaker