Link to home
Start Free TrialLog in
Avatar of amd_kickass
amd_kickass

asked on

VBScript to remove shares by server name

All,

I am looking for a VBscript to remove network drives when they are mapped to a specific server not by drive letter
e.g.

X: \\server1\share1
Y: \\server2\share
Z: \\server1\share33

in this example drives X & Z would be removed but these could be any letters on a different machine

Cheers,
Mark
ASKER CERTIFIED SOLUTION
Avatar of Shift-3
Shift-3
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amd_kickass
amd_kickass

ASKER

Thanks,

It works correctly but does not end cleanly it terminates with the following error:
(14, 17) Microsoft VBScript runtime error: Type mismatch: 'objNetwork.RemoveNetworkDrive'

Regards,
Mark
I'm not able to replicate the error.  However, if it is removing the drives correctly then the simplest solution would be to add On Error Resume Next to the beginning of the script.