Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Server Setup > "Parameter is incorrect"

Reply
Thread Tools Display Modes

"Parameter is incorrect"

 
 
Kelvin
Guest
Posts: n/a

 
      08-06-2009
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


 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a

 
      08-07-2009
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
>


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup fails with "parameter is incorrect Ox80070057" Bob1759 Windows Vista Performance 0 12-23-2008 05:34 PM
"Parameter is incorrect" for SOME file copy SharePoint to Vista NO LarryPullingTeeth Windows Vista General Discussion 0 01-18-2008 01:14 PM
"Parameter is incorrect" installing driver for any USB storage dev Paul B Windows Vista Hardware 0 11-23-2006 05:19 PM
Re: GetLicenseFromURL,msnetobj.dll, error 80070057 "parameter incorrect" ... Xlnt Windows Media Player 0 10-07-2004 07:25 PM
error 80070057 "Parameter is incorrect" on license b/up & restore Bill Windows Media Player 0 05-06-2004 12:56 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59