Set objNetwork = CreateObject("WScript.Network")
Dim Ask
Ask = inputBox("user:")
strUser = "test"
If Ask = strUser Then
set Ask = nothing
Ask = inputBox("password:")
strPassword = "test"
if Ask = strPassword then
set ask = nothing
end if
elseif MsgBox("error") Then
location.reload(true)
end If
strDriveLetter = "x:"
strRemotePath = "\\192.168.1.1\tests"
strProfile = "False" ' means do not store in profile leave as false.
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, strProfile, strUser, strPassword
Call ShowExplorer
Sub ShowExplorer()
Set objShell = CreateObject("WScript.Shell")
objShell.run ("Explorer" & " " & strDriveLetter & "\" )
End Sub