Heya,

I tried this little code:
code:
  $test = USE /List   
While $test <> ""
if Instr(Substr($test, 1, 2),"Z:") <> 1
Loop
Else
$t = Substr($test, 1, 2)
USE $t /delete
Loop
ENDIF

but it doesnt work [Smile]
The only way to delete all mapped network drives except Z: is to make something like:

code:
  $shares = "E:", "F:", "G:", "H:", "I:", "J:", "K:", "L:", "M:", "N:", "O:", "P:", "Q:", "R:", "S:", "T:", "U:", "V:", "W:", "X:", "Y:"

for Each $element In $shares
USE "$element" /delete

Next

But isn't there a better method?

tnx in advance

ps: for making it a little bit more advance...
I whould like the get all the IPC$ shares which are open and I want them to get deleted.
Like: \\bla\ipc$
\\bla2\ipc$

I want it to delete all open ipc$ connections and leave the rest alone (so first it kills all drive mappings except Z: then it kills all open connections to ipc$ shares.)

[ 21. November 2002, 13:09: Message edited by: bpsysadmin ]