Here is my code atm. I can not figure out how to implement Exec as you suggested....
<HEAD>
<TITLE>IT - Cache Credentials</TITLE>
<HTA:APPLICATION
icon="e-icon-new-round.ico"
ID="InstallApps"
BORDER="thin"
CAPTION="yes"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
SCROLL="yes"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
</HEAD>
<hta:application icon="e-icon.ico" />
<script language="VBScript">
ON ERROR RESUME Next
Set WshShell = CreateObject("WScript.Shell")
Set objExplorer = CreateObject ("InternetExplorer.Application")
Set fso = CreateObject("scripting.filesystemobject")
'_______________________________________________________________________________________
'Resize the window when the app starts
'_______________________________________________________________________________________
Sub window_onload
centerWindow
usrName.focus()
End Sub
'_______________________________________________________________________________________
'Center and size the window
'_______________________________________________________________________________________
sub centerWindow
window.resizeTo 600,675
window.moveTo (screen.width - 600) / 2, (screen.height - 675) /2
End sub
'_______________________________________________________________________________________
'Closes the application if the Exit button is clicked
'_______________________________________________________________________________________
sub killApp
If fso.FileExists ("c:\Cache Credentials.lnk") Then
fso.DeleteFile ("c:\Cache Credentials.lnk")
End If
window.close
End sub
'_______________________________________________________________________________________
'Runas command to cache credentials.
'_______________________________________________________________________________________
Sub cacheCreds
On Error Resume Next
Err.Clear
userName = usrName.value
If userName = "" Then
MsgBox ("Error: Username and password are required")
Exit Sub
End If
If Right(Left(userName,4),1) = "\" Then
userName = Mid(userName,5,(Len(userName)))
usrName.value = userName
End If
runCmd ="runas /profile /user

OMAIN\" & userName & " notepad"
retResults = WshShell.Run (runCmd,1,True)
If retResults <> 0 Then
MsgBox ("Incorrect password, please try again.")
usrName.value = ""
MsgBox "error: " & (retResults)
Exit Sub
End If
killApp
End Sub
</script>
<body bgcolor="#f1f2f2">
<font color = "black">
<font size ="4" face = "arial"><center><u><b>Cache Domain Credentials<br><br></b></u></font>
<font size ="2" face = "arial"><b>You must be connected to the internal network either at an office or with VPN before you continue.</b></font size face = "arial"></center></b><br><hr>
<font size ="2" face = "arial">Enter your domain username and password and then click continue. Do not enter the DOMAIN\ prefix before your username. After you click continue, you will be prompted again for your password.<br><br></font>
<font size ="2" face = "arial"><left>Domain Username: <br>
<input type="textbox" name="usrName"><br>
<br>
<input type="image" src="continue.gif" name="next_event" onClick="cacheCreds">
<input type="image" src="cancel.gif" name="run_button" onClick="killApp">
</font>
</body>