I would recommend that you investigate the UDF WSHPIPE(). I see you using this UDF to perform and capture the output of "Net Use". then examining each line to determine if the server name in question is present. If it is then parse the line to get the drive letter and "Use $drive /delete /persistent" it.
_________________________
Home page: http://www.kixhelp.com/hb/