Mian

Executing an SISS package through autoit

3 posts in this topic

I wrote the following script. I have similar scripts to open internet explorer and excel when the user is not logged in and they work fine. The following script which opens an SSIS package and execute it is working fine when the user is logged in but stop working when the user is logged off. It stops after opening the SSIS package. I dont know why controlsend is working in the other two scripts but not in this one. Please help.

 

ShellExecute("C:\Users\xyz\Desktop\exescripts\PackageToUploadDataToSqlServer.dtsx")
sleep(5000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(500)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(500)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(500)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(500)
ControlSend("Execute Package Utility", "", "", "{ENTER}")
sleep(50000)
ControlSend("Package Execution Progress", "", "", "{TAB}")
sleep(1000)
ControlSend("Package Execution Progress", "", "", "{ENTER}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{TAB}")
sleep(1000)
ControlSend("Execute Package Utility", "", "", "{ENTER}")
sleep(1000)


Exit

 

Share this post


Link to post
Share on other sites



Try to get the class of the window with autoit info tool and get handle of the window title

$hWnd = WinWait("[Here is class of your program process]", "Execute Package Utility", 2)

$process = WinGetHandle(WinGetTitle($hWnd2))

ControlSend($process, "", "[CLASS......]", "{tab}")

 

Share this post


Link to post
Share on other sites

Thanks for the tip, I will try it.

I also found that there is a command line utility DTexec.exe, which can run the SSIS package from commandline. I created the batch script and added it to the task scheduler.

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

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      I have a question
      about the display language of the system
      How can I get the current display language and how can I change it by autoit
      Of course, if this is possible
      Greetings to all and hope you help me
    • breakbadsp
      By breakbadsp
      AutoIT AU3info doeas not detect all gui objects uniquely for .NET GUIs developed in C#.
      this is not working now i am using COM windows approach for this, But its very difficult.
      Please let me know if anyone has done it before.
    • ur
      By ur
      With _WinWaitActivate we can wait for a window to process it.
      But is there any logic so that we can wait for this window title and based on the window text (like 2 or more patterns will be there) we can click yes or no on the window.
       
      Func _WinWaitActivate($title,$text,$timeout=0)
       WinWait($title,$text,$timeout)
       If Not WinActive($title,$text) Then WinActivate($title,$text)
       WinWaitActive($title,$text,$timeout)
      EndFunc
    • wtarkan
      By wtarkan
      If I create a service to run a program , Application window cannot Appear - How can I make the App window visible
    • ur
      By ur
      Whenever we try to access a network share it will prompt for credentials based on the shared folder settings.
      Like the below prompt


      Once you save them, they are saved in Windows Credentials of Credentials Manager in Control panel (run --> control keymgr.dll).

       
      But not able to found exact file or registry for this setting.
       
      So, can anyone suggest how to do this process of adding network credentials using AutoIT.