I didn't have time to try but try instantiating the object.
Set WshNetwork = CreateObject("WScript.Network")
--
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"Kelvin" wrote:
> I'm getting an error that my script in 23 (the line that starts with "
> WSHNetwork") has an error at Char 5. Error: "Parameter is incorrect"
> Code: 80070057
> Source: WSHNetwork.RemoveNetworkDrive
>
> ++++++++++++++++++++++++++++++++++++++++++++++++
> Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj,
> Path
> 'Disconnect ALL mapped drives
> Set clDrives = WshNetwork.EnumNetworkDrives
> For i = 0 to clDrives.Count -1 Step 2
> WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, True
> Next
>
> 'Give the PC time to do the disconnect, wait 300 milliseconds
> wscript.sleep 300
> ++++++++++++++++++++++++++++++++++++++++++++++++
>
> I thought I had this part working, but now it's kicking up an error...
>
> I'm not much of a programmer so don't have much to go on to resolve this.
> Is there a better way to do this, or can someone show me what I need to
> change to make this work?
>
> XP Pro workstations
> MS 2003 Server
>
> Thanks a million!
>
> Kelvin
>