RunAs using an HTA
Posted: Tue Sep 07, 2010 11:46 pm
Hello,I'm looking for some assistance with using an HTA form to launch another hta file as a Domain administrator. (domainusername) any ideas or maybe a best practice for this type of situation where an hta file needs admin rights to run?uploads/34385/runas.txtI don't think my attachment came through so I'm going to paste my code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- ... dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>TSM POST SETUP</title></head><script language="vbscript">Sub send_onclick()on error resume next sPSExec = "psexec /accepteula -u " & sUserID & " -p " & sUserPassword & " " & "" sCmd = sPSExec & "cscript.exe filestest4.hta" Set oShell = CreateObject("WScript.Shell") oShell.run sCmdend sub</script><body><body style="background-color: #EF0000"> Type you AX Account<br /> <Input type=text name="sUserID" tabindex=1 size="20"><br> Type your Password (AX Account) <br /> <Input type=password name="sUserPassword" tabindex=1 size="20"> <br /> <br /><input name="Button1" type="button" value="Login" /></body></html>