Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to RunAs different users with Internet Explorer
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi ,

Use the below Code,


Code:
Dim objShell, objNetwork
Dim domain, program, domainUser

Set objShell = CreateObject("WScript.Shell")
Set objNetwork = WScript.CreateObject("WScript.Network")
domain = objNetwork.ComputerName
program = "notepad.exe"
domainUser = getUserName
WScript.Sleep 1000
runAsDomainUser domain, domainUser, program


Function runAsDomainUser(fxDom, fxUser, fxProgram)

   MsgBox "runas /env /user:" & fxDom & "\" & fxUser & " " & Chr(34) & fxProgram & Chr(34) & "",0,"This is what is being passed to RUNAS"
   objShell.Run "runas /env /user:" & fxDom & "\" & fxUser & " " & Chr(34) & fxProgram & Chr(34) & "",1,False
  
End Function


Function getUserName

  getUserName = InputBox("Enter your Domain or Local Computer UserName")
  If getUserName = "" Then
    WScript.Quit
  End If
End Function
Reply


Messages In This Thread
RE: How to RunAs different users with Internet Explorer - by JyotiRanjan - 03-30-2011, 09:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting URL from Internet Explorer BVVPrasad 1 4,686 07-25-2011, 08:24 AM
Last Post: rajpes
  Internet Explorer has stopped working kotaramamohana 8 11,898 03-07-2011, 02:22 PM
Last Post: krupaluk
  Problem with invoking url in internet explorer vijay44 1 3,053 01-21-2010, 01:11 PM
Last Post: Saket
  Automate Rice Internet Tier sgorantiwar 0 1,777 01-21-2009, 06:03 PM
Last Post: sgorantiwar
Question How to execute RunAs command in QTP? ashokghali 2 7,210 03-07-2008, 03:58 PM
Last Post: ashokghali

Forum Jump:


Users browsing this thread: 1 Guest(s)