Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

VBS Drive Mapping - Using Input string for username & password

$
0
0

I''m trying to setup a vbs script to prompt a user to enter their username & password to map through to a third party network. I've come up with the script below which prompts correctly, however i'm unsure if i'm storing the entered details correctly and then how to use these when mapping the network drive.

x=msgbox("Please logon with your Username and Password. The username will be of the form Domain\Username. Remember to include the Domain\" ,0, "Login to System")
strUsername = Inputbox("Enter Your Username" ,, "Username")
strPassword = Inputbox("Enter Your Password" ,, "Password")

Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "l:" , "\\192.168.68.48\test" /user:" & strUsername &  /pass:" & strPassword

Any information on achieve this would be really appreciated.

Thanks


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>