February 6, 2022 at 12:51 am
Hi everyone
I am creating an SSIS package where I run an windows program to download data. The data provider doesn't allow people to make direct connections to their DB so the only way to get the data is from their windows app. I am writing a script that accesses that program and downloads the data. For the most part, my Powershell script does the job. It runs the program, downloads the data, and closes the program. There is one part that I am stuck on. The app has a button that converts the data from their propriety format to CSV. The button doesn't appear to be accessible by a keyboard shortcut. I can't even use tab to access it. It is only accessible by using the mouse to select it. Is there a way to use SSIS to somehow access that button? I am thinking ... maybe search for the text "Convert" in the app and once found then press enter. Not sure how to do this.
If the entire script needs to be redone that is ok with me. I have attached my script.
Start-Process -FilePath "program path"
$ProcId = (Get-Process program_name).id
Sleep -Seconds 60 # give the program 1 minute to open
$wshell = new-object -com wscript.shell
$wshell.AppActivate("program_name")
$wshell.Sendkeys("%d")
Sleep -Seconds 600 # give the program 10 minutes to finish the download
# select Convert button ... how to do this?
#$wshell.Sendkeys("%c")
#Sleep -Seconds 600 # give the program 10 minutes to convert the data to CSV
Stop-Process $ProcId
Thank you
February 6, 2022 at 12:53 am
one more thing ...
I am using Powershell but I am definitely open to using other tools like C# etc. I just need a way to access that one button. The rest of the app is accessible by keyboard so some variation of sendkeys will work.
February 6, 2022 at 5:26 pm
I think you will have much better luck in a forum for C# or Powershell. There is nothing built into SSIS or SQL Server that does this type of work.
I would follow up with the vendor to see if they have a command-line utility or API available. A lot of times you will find that the EXE can be called with command line options which do what you are asking - or the vendor has a separate utility available.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
February 6, 2022 at 7:44 pm
good points. Thank you for that.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply