Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Map Network Drive with Remember Password

Reply
 
Old 06-10-2008   #1 (permalink)
jfcby


 
 

Map Network Drive with Remember Password

Hello,

How can the following VBScript be changed to remember the password so
that after the PC is restarted the mapped drive is still connected?

[VBScript -- Begin]

On Error Resume Next
Dim oNetwork

Set oNetwork = CreateObject("WScript.Network")

strDrive = InputBox("Do NOT CHANGE Network Drive Letter:", "Network
Drive Letter", "Z:")
strPath = InputBox("DO NOT CHANGE Network Path:", "Network Path", "\
\server\share")
Set strUser = InputBox("Enter User Name:", "User Name", "username")
Set strPassword = InputBox("Enter Password:", "Password", "Password")

Disconnect Mapped Network Drive
oNetwork.RemoveNetworkDrive strDrive
WScript.Sleep 2000

'msgbox "Disconnecting Network Drive..."

'Connect Map Network Drive
oNetwork.MapNetworkDrive strDrive, strPath, False, strUser,
strPassword
WScript.Sleep 2000

'msgbox "Connecting Network Drive..."

[VBScript -- End]

Thank you for your help,
jfcby

My System SpecsSystem Spec
Old 06-10-2008   #2 (permalink)
jfcby


 
 

Re: Map Network Drive with Remember Password

I want the mapped drive to stay connected after I "Shut Down" my PC
but so far un-successful.

I think the problem is located in this part of the script: >
oNetwork.MapNetworkDrive strDrive, strPath, False, strUser,
strPassword.

This is what I've already tried and it did not work:
1. I've tried changing False to True: > oNetwork.MapNetworkDrive
strDrive, strPath, True, strUser, strPassword

2. I've tried leaving it blank: > oNetwork.MapNetworkDrive strDrive,
strPath, , strUser, strPassword

There is something I'm missing and I have not figured it out yet. I've
searched this news group and Google but I keep finding the type of
script posted below.

What changes can be made to the following script so that after I shut
down my pc and restart, the drive is still connected without having to
login?
Quote:

> [VBScript -- Begin]
>
> On Error Resume Next
> Dim oNetwork
>
> Set oNetwork = CreateObject("WScript.Network")
>
> strDrive = InputBox("Do NOT CHANGE Network Drive Letter:", "Network
> Drive Letter", "Z:")
> strPath = InputBox("DO NOT CHANGE Network Path:", "Network Path", "\
> \server\share")
> Set strUser = InputBox("Enter User Name:", "User Name", "username")
> Set strPassword = InputBox("Enter Password:", "Password", "Password")
>
> Disconnect Mapped Network Drive
> oNetwork.RemoveNetworkDrive strDrive
> WScript.Sleep 2000
>
> 'msgbox "Disconnecting Network Drive..."
>
> 'Connect Map Network Drive
> oNetwork.MapNetworkDrive strDrive, strPath, False, strUser,
> strPassword
> WScript.Sleep 2000
>
> 'msgbox "Connecting Network Drive..."
>
> [VBScript -- End]
Thank you for your help,
jfcby

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
MAP network drive does not remember logon info Vista networking & sharing
Network Drive Does not Remember Password (Vista) Vista networking & sharing
Why Vista keep forgetting password shared network? remember checkedoff. Vista General
Vista won't remember my mapped network drive password ? Vista networking & sharing
Network Drive Does not Remember Password Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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