Question : VBS scripting to map network drives

Ok, I'm a newbie to the VBS world, but I am putting forth a great effort...(i think so anyway)
Anyway here is my problem:
I need to script that a user may click on, and it will first check to see if drives Y: and Z: are already mapped. If they are, delete them.
I then I need to prompt the user for their user name, and their password.
Using these credentials, I will then map Y: & Z:
========
This is what I have thus far:

Set objNetwork = Wscript.CreateObject("WScript.Network")

' Check to see if the drives exist
objNetwork.RemoveNetworkDrive "Y:"
objNetwork.RemoveNetworkDrive "Z:"

'Map Drives
'On Error Resume Next
objNetwork.MapNetworkDrive "Y:", "\\server\share"
'On Error Resume Next
objNetwork.MapNetworkDrive "Z:", "\\server\share2"

Answer : VBS scripting to map network drives

Please check this.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
On Error Resume Next
Set objNetwork = Wscript.CreateObject("WScript.Network")
 
' Check to see if the drives exist
objNetwork.RemoveNetworkDrive "Y:"
objNetwork.RemoveNetworkDrive "Z:"
 
WScript.Sleep 2000
 
Set strUser = InputBox("Enter User Name:", "User Name", "username")
Set strPassword = InputBox("Enter Password:", "Password", "Password")
 
 
'Map Drives
objNetwork.MapNetworkDrive "Y:", "\\server\share", False, strUser, strPassword
objNetwork.MapNetworkDrive "Z:", "\\server\share2", False, strUser, strPassword
Random Solutions  
 
programming4us programming4us