Jump to content
Nareshm

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

Recommended Posts

Nareshm

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

 

Share this post


Link to post
Share on other sites
Nine

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 ?

Share this post


Link to post
Share on other sites
Nareshm
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.

Share this post


Link to post
Share on other sites
Nine

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

Share this post


Link to post
Share on other sites
Nareshm
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

Share this post


Link to post
Share on other sites
Nine
1 minute ago, Nareshm said:

How to use winlist ?

Help file is your best friend ! Look at example #2 

Share this post


Link to post
Share on other sites
Nareshm
10 minutes ago, Nine said:

Help file is your best friend ! Look at example #2 

Adding this before code does not helpful.

$ie_handle1 = winactivate("[CLASS:IEFrame]")
$oIE = _IEAttach($ie_handle1 ,"HWND" )

 

Share this post


Link to post
Share on other sites
Nine
6 minutes ago, Nareshm said:

Adding this before code does not helpful

Agree and where is the winlist in there ?

Share this post


Link to post
Share on other sites
Nareshm

i am not undesrstand winlist 

Share this post


Link to post
Share on other sites
Nareshm

@Nine How can i ieattach IE windows ?

Share this post


Link to post
Share on other sites
Nine
5 minutes ago, Jos said:

Are you sure?

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

Share this post


Link to post
Share on other sites
Nine
37 minutes ago, Nareshm said:

How can i ieattach IE windows ?

Have you tried to use instances in the ieattach ?

Share this post


Link to post
Share on other sites
Nareshm
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

Share this post


Link to post
Share on other sites
Jos
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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Nine
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.

Share this post


Link to post
Share on other sites
Jos
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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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

×