Further testing reveals a code update is required. When deleting something that does not have a drive letter associated with it such as "\\server\IPC$" the use statement needs to be adjusted.
code:
for each $line in WshPipe("net use",1)
if left($line, 2) = "OK"
$drive = substr($line, 14, 2)
$path = substr($line, 24)
$path = left($path, instr($path, " ")-1)
if $drive <> "Z:"
if $drive = " "
;use $path /del
? "use $path /del "
else
;use $drive $path /del /persistent
? "use $drive $path /del /persistent"
endif
endif
endif
next
I originally thought that if the $drive variable contained spaces the free form langauage nature of KiXtart would just ignore it and process the command. Instead it generates an error. quote:
2250 This network connection does not exist.
I added an extra conditional to account for this condition.