Jump to content
learner123

AuTO IT script not working when server is disconnected or minimised

Recommended Posts

Hi All,

 

I am new to this AUTO IT and I have created a script that will open an app,enter pin and copy the code generated to clipboard. My java code call this autoIT script and use the copied generated code from clipboard.

This works fine when server  window is on focus. My server is an windows server. 

But when I minimize or disconnect the server, the script opens the app.exe but doesn't copy any value to clipboard.  

Can anyone help me on this 😐

 

Run("C:\Program Files (x86)\RSA SecurID Software Token\SecurID.exe")
Local $hWnd=WinWait("abc - RSA SecurID Token") ; waits until the window is the active window
$hWin = WinGetHandle("abc - RSA SecurID Token");
ControlSend($hWnd,"","","1111") ; simulates pressing the Home key
ControlSend($hWnd,"","","{ENTER}");
ControlSend($hWnd,"","","^c");
Sleep(1000) ;
ControlSend($hWnd,"","","^c");

 

Share this post


Link to post
Share on other sites

what task are you  trying to accomplish? What is the end goal? Please describe what it is you wish to accomplish, many times there are better ways to do it.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites

@Earthshine

Hi Earthshine,

So there is a RSA app located in my server that generates a token number after we enter a password in it and I need this token number in my java code. 

So since this opening of RSA, entering password and copying generated code involves keyboard interaction, I have used AuTOIT . 

After copying is done code resides in clipboard and I retrieve this clipboard value in my java code and use it.

 

I am new to automation so let me know if you have any other suggestion to achieve this functionality, i will look into it.

Share this post


Link to post
Share on other sites

How is this different from your earlier thread? Also, have you checked the forum rules to be sure that you aren't breaking them? Specifically --

Quote

Forum Posting

1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects:

  • Bypassing of security measures

 

Share this post


Link to post
Share on other sites

 

10 minutes ago, learner123 said:

How is my question bypassing security measures?

 

Maybe because it is almost identical to the topic below, which got locked.

 

Share this post


Link to post
Share on other sites
3 minutes ago, TheXman said:

 

 

Maybe because it is almost identical to the topic below, which got locked.

 

@TheXman

So In my project we are creating an application which is used to test the accessibility of many of our client's sites. we check if we are able to reach the URL, open the URL using credential and check some data inside those URL.

So there is one app within which many URL are present which we need to check and to access this application it requires RSA token as password . So we have created a script for it. 

 

Share this post


Link to post
Share on other sites

There's no need to explain anything to me.  😃  I'm neither a Moderator nor a MVP (like Danp2).   I just offered an explanation as to why there may be some hesitancy in assisting you at this point.  As Danp2 said, if a Moderator says it is okay, then I'm sure that someone will try to help.

Edited by TheXman

Share this post


Link to post
Share on other sites

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!

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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Gowrisankar
      Dear members of the forum,
      I'm working on a project in which I have to use Image recognition technique. 
      Due to client restrictions, I couldn't use AutoIt for this project. 
      Is there a way to use this DLL "ImageSearchDLL.dll" (which is used to do image recognition steps in AutoIt) in VB.Net to achieve the same result? 
      I have used this DLL few years before and got good results. If there is a latest version of this DLL and if you can share it, that will be helpful too.
      Any guidance is deeply appreciated.
    • By learner123
      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}")
       
       
    • By poddex
      Hello everyone.
      I always try to work with old Windows 10 versions as much as possible because I know mane compatibility issues with Windows 10 upgrading. 
      But I couldn't do anything else (I got drivers problem), and nothing couldn't help me besides upgrading, so I upgraded from 1807 to 1903.
      And...get another problem 😃
      I use AutoitX library in external project like this.
      ObjectAutoIt=New COMObject("AutoItX3.Control");
      ObjectAutoIt.AutoItSetOption("WinTextMatchMode",2);
              While ObjectAutoit.WinExists("",WindowHeader) Cycle 
                  ObjectAutoIt.WinClose("",WindowHeader);
              EndCycle;
      After upgrade I get that this line code 
      While ObjectAutoit.WinExists("",WindowHeader)
      become extremely low - ~ 20 seconds even if 10 windows open. But before upgrade it takes 0.5 s for a max.
      And every time that this code line passes through  - it takes ~20s, (20.115, for example), not less, not more. Something pauses it to work.
      How can I diagnose, what is that?
      I tried reinstall whole AutoIt, but no results.
      Thanks to all.
    • By JuanFelipe
      Hello gyus, I try to make a code to login in a web page in my job, buy i can’t understand why my form is blocked, this is my code: 
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <StringConstants.au3> #include <WindowsConstants.au3> #include <WinAPIFiles.au3> #include <FileConstants.au3> #include <File.au3> #include <Array.au3> #include <IE.au3> #include <Excel.au3> #include <GuiEdit.au3> #include <GuiStatusBar.au3> #include <DateTimeConstants.au3> #include <Date.au3> #Region ### START Koda GUI section ### Form=C:\noentry\koda_1.7.3.0\Forms\spoa.kxf $Form1 = GUICreate("Eva y Vehículos", 1200, 1000, 10, 10) $prueba = GUICtrlCreateButton("Prueba",10,990,50,20) ;VARIABLES ========================================================================================== $psi = "https://psi.policia.gov.co/PSI/Login.aspx?ReturnUrl=%2fPSI#no-back-button" $chequeVehiculos = "https://psi.policia.gov.co/PSI/frm_lista_chk.aspx" $evaluacionEva = "https://psi.policia.gov.co/PSI/eva_frmver.aspx" $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ($oIE, 10, 10, 1180, 980) ;GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) $oIE.navigate($psi) ;_IELoadWait($oIE) _InicioSesion() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $prueba _InicioSesion() EndSwitch WEnd Func _InicioSesion() Local $username = _IEGetObjByName($oIE, "txtUsuario") Local $pass = _IEGetObjByName($oIE, "txtClave") Local $logina = _IEGetObjByName($oIE, "btnIngresar") $username.value="example" $pass.value="examplepass" _IEAction($logina, 'click') _IELoadWait($oIE) MsgBox(16,"","") EndFunc  
×
×
  • Create New...