Welcome to my world

Network login script for Windows XP Home

I just needed a script to log in on a Windows 2003 Server from Windows XP Home. Of course you can enter your password each time you need to access the shares - or you could just drop this little script in your Startup folder (call it 'network_login.vbs' for example).


{codecitation class="brush:vb"}' VBScript to map a network drive. And provide a message box
' Author Berend Dekens
' Based on code from Guy Thomas
' -----------------------------------------------------------------
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, bSaveMapping, strUserName, strPassword
strDriveLetter = "Z:"
strRemotePath = "\\\sharename"
bSaveMapping = true
strUserName = "yourname"
strPassword = "mysecretpassword"
' Purpose of the script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result Z: drive
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, bSaveMapping, strUsername, strPassword
' Extra code just to add a message box
WScript.Echo "The networkdrive "& strDriveLetter & " is now available"
' End of MapNetworkDrive Example Logon Script. {/codecitation}