Jump to content

Auto It Script not working in Remote window server when window not in focus


Recommended Posts

Hi All,

So I have created a small autoIT script to enter pin into a RSA token(app which generate new code every 30 second), and copy the generated code.

I have a java application which requires this code so every time my java-code requires this RSA code, it runs the autoIT script and the copied generated code is then used in my java application. 

I have deployed this code on a windows server and it works fine when I am logged in and the window is on focus, But as soon as I schedule task and disconnect the server (not logged out only disconnect), or even minimize the server window, the autoIT scripts fails and its not able to copy the value.

 

Please find below the code for AUTOIT.

 

WinActivate("rsa - RSA SecurID Token") ; activates the window that has old in the tilte bar
WinWaitActive("rsa - RSA SecurID Token") ; waits until the window is the active window
Send("1111") ; simulates pressing the Home key, enters password to get the code
Send("{ENTER}") ; simulates pressing the Enter key
Sleep(1000) ;
Send("^c") ; simulates pressing the CTRL+c keys (copy)

 

Also I saw some post regarding that WINACTIVE only works when window is active. But my below AUTO IT script to handle windows pop up  works perfectly fine when the server is disconnected. 

 

Opt("WinTitleMatchMode", 1)
WinWait("https://url","","10")
WinWaitActive("https://url","","10")
Sleep(2000)
Send("userid")
Sleep(1000)
Send("{TAB}")
Sleep(1000)
Send("passwrd")
Send("{TAB}")
Sleep(500)
Send("{ENTER}")

 

 

Link to comment
Share on other sites

I changes the script as below but this too is not working when server window is minimized.

 

Opt("WinTitleMatchMode", 1)
Local $hWnd=WinWait("rsa- RSA SecurID Token") ; waits until the window is the active window
ControlSend($hWnd,"","","1111") ; simulates pressing the Home key
ControlSend($hWnd,"","","{ENTER}");
ControlSend($hWnd,"","","^c");

Link to comment
Share on other sites

  • Moderators

Locked for the same reason as the other thread (also stick to one thread in the future).

Quote

The entire point of an RSA token is to mitigate security risks. To think that the software/systems owner would be okay with you bypassing it is simply foolish. If you have permission from the application owner to bypass their token, in writing, feel free to PM it and we'll review. Until that time, however, we will not support this (or the other) thread on this subject.

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...