Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash desktop drive driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory missing monitor motherboard network printer problem ram random registry router slow software sound trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Question regarding VBScript Code

Reply  
Thread Tools
kimcarl's Avatar
Junior Member with 7 posts.
 
Join Date: Feb 2009
10-Feb-2009, 03:49 AM #1
Question regarding VBScript Code
Here's a very simple script that unmaps all drives:

'Start of Code
Set objNetwork = CreateObject("WScript.Network")
Dim AllDrives: Set AllDrives = objNetwork.EnumNetworkDrives()
IF NOT AllDrives.Count = 0 THEN
For i = 0 To AllDrives.Count - 1 Step 2
objNetwork.RemoveNetworkDrive AllDrives.Item(i), TRUE, TRUE
Next
END IF
Wscript.Echo "Unmapped all drives."
'End of Code

The script works fine MS Windows Server 2003 SE SP2. But when I run it on MS Windows Server 2003 SE SP1, I got this error:

Error: The parameter is incorrect.
Code: 80070057
Source: WSHNetwork.RemoveNetworkDrive

I tried modifying the arguments. Stored them in variables. Excluding them (except the drive letter) but I still get the same error. Any insights?
Reply

Tags
error, script, vbscript

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:27 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.