Jump to content

How to control IE windows created by a different user via runas ?


naru
 Share

Recommended Posts

I want to paste 15 digit number into webpage was already opened in IE windows created by a different user via runas. But i dont know i how to attach ie windows when IE windows created by a different user.

My code is :

#include <IE.au3>
$sData = ClipGet()
$oIE = _IEAttach ("Search Member")
WinActivate("[CLASS:IEFrame]")
$oObj = _IEGetObjByName($oIE,"15dignumber")
_IEPropertySet($oObj,"innertext",$sData)
$btnsearch = _IEGetObjById($oIE,"btnsearch")
_IEAction($btnsearch,"click")
exit

 

Link to comment
Share on other sites

10 minutes ago, Nine said:

Doesn't matter if the IE windows is created by same user or not.  At first I'd say that your script looks good.  What doesn't work ?

@Nine I already opened two ie windows with same url, and i want to send copied text into second ie windows that was created by run as different user.

Link to comment
Share on other sites

16 minutes ago, Nine said:

You got to find out which one is which.  Maybe use winlist to get the 2 handles and link them to your IE objects.

How to use winlist ? and how to link them to IE objects?

Edited by Nareshm
Link to comment
Share on other sites

  • Developers
2 hours ago, Nine said:

Doesn't matter if the IE windows is created by same user or not. 

Are you sure?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

6 minutes ago, Nine said:

Have you tried to use instances in the ieattach ?

Yes, i tried but it does not working.

#include <IE.au3>

$oIE = _IEAttach("[REGEXPTITLE:Home; INSTANCE:1]", "embedded", 1)
$body = _IEBodyReadHTML($oIE)
 $sData = ClipGet()

$oObj = _IEGetObjByName($oIE,"userRationCard")
_IEPropertySet($oObj,"innertext",$sData)
$btnrationnext = _IEGetObjById($oIE,"btnrationnext")
_IEAction($btnrationnext,"click")

 

Edited by Nareshm
Link to comment
Share on other sites

  • Developers
50 minutes ago, Nine said:

I believe so, if it was created with a runas...like he said and not under a separate session.  

Doesn't runas imply that the program runs under different credentials and thus not in control by the current session?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

6 hours ago, Jos said:

Doesn't runas imply that the program runs under different credentials and thus not in control by the current session?

We are talking about Internet Explorer !  Not an obscure admin command.  Anyway this convo will not help in any way OP.

Link to comment
Share on other sites

  • Developers
8 hours ago, Nine said:

Anyway this convo will not help in any way OP.

No idea what you are saying but if you feel this doesn't help the OP then be my guest. 

@Nareshm,

I am pretty sure the script won't work when the running script and program credentials aren't the same, but it seems Nine knows more.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...