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
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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.
ASKER
It works correctly but does not end cleanly it terminates with the following error:
(14, 17) Microsoft VBScript runtime error: Type mismatch: 'objNetwork.RemoveNetworkD
Regards,
Mark