Bob
2014-11-09 19:28:09 UTC
Looking for better method than SendKeys in VB to open, control and close a
program to insure the commands are getting to the right application.
I was mediocre programmer in VB6 way back when. I can get around using VB
scripting and VBA after some review. I'm retired now and have not kept up
with the latest and greatest like PowerShell but I have played with it.
I have a friend that runs a small business and I maintain his systems and
networks. Recently he had to upgrade the software which he runs his business
on - Mitchell 1, if you're familiar with that. In the past, you could
perform a manual backup from designated clients whenever the client was
closed out for the day. With the upgrade, that capability is now only
available from the server and cannot be automated from within the program -
only manually. The server is not readily available for someone to get access
to and perform the backup - and I would want them to...
I've made up a script that performs an automated manual backup of the
database at a specific time right after closing time from the server. That
backup is copied to a local drive, a NAS and to an offsite location.
Additionally, backup images of the server and clients are made every night.
That pretty well covers being able to recover the server, clients and
database for getting things working again fairly quickly but is not user
friendly recovery method for the typical user.
The manual backup file is a special type of backup that a user can initiate
easily should the database be corrupted and is done from within the software
the user is familiar with. So it's important to have that backup done each
night. The server is not easily accessed to prevent any user from
accidentally using that computer but the owner does have access.
The server stays in a pretty static condition 99% of the time but it's that
1% that bites you in the butt - and has using the SendKeys method. Mitchell
is not about to provide an API for me to use so I'm looking for a fool proof
method that will work even if the focus of the program is lost during
execution of the backup. Have done a lot of research and tried AutoIt and
several iterations of a VB API replacement for SendKeys which I could not
get to work.
Anyone have an example VB program or a site reference for a script, program
or a PowerShell cmdlet (I'll learn it...) that uses a bullet-proof method
for opening an instance of a program, send (key) commands in response to the
programs pop-up windows and then close out the program (gracefully) no
matter what else may be going on with other applications or operating
system?
I'll keep looking and trying but if you have licked this problem yourself,
I'd like to read what you did.
Thank you,
Bob S.
program to insure the commands are getting to the right application.
I was mediocre programmer in VB6 way back when. I can get around using VB
scripting and VBA after some review. I'm retired now and have not kept up
with the latest and greatest like PowerShell but I have played with it.
I have a friend that runs a small business and I maintain his systems and
networks. Recently he had to upgrade the software which he runs his business
on - Mitchell 1, if you're familiar with that. In the past, you could
perform a manual backup from designated clients whenever the client was
closed out for the day. With the upgrade, that capability is now only
available from the server and cannot be automated from within the program -
only manually. The server is not readily available for someone to get access
to and perform the backup - and I would want them to...
I've made up a script that performs an automated manual backup of the
database at a specific time right after closing time from the server. That
backup is copied to a local drive, a NAS and to an offsite location.
Additionally, backup images of the server and clients are made every night.
That pretty well covers being able to recover the server, clients and
database for getting things working again fairly quickly but is not user
friendly recovery method for the typical user.
The manual backup file is a special type of backup that a user can initiate
easily should the database be corrupted and is done from within the software
the user is familiar with. So it's important to have that backup done each
night. The server is not easily accessed to prevent any user from
accidentally using that computer but the owner does have access.
The server stays in a pretty static condition 99% of the time but it's that
1% that bites you in the butt - and has using the SendKeys method. Mitchell
is not about to provide an API for me to use so I'm looking for a fool proof
method that will work even if the focus of the program is lost during
execution of the backup. Have done a lot of research and tried AutoIt and
several iterations of a VB API replacement for SendKeys which I could not
get to work.
Anyone have an example VB program or a site reference for a script, program
or a PowerShell cmdlet (I'll learn it...) that uses a bullet-proof method
for opening an instance of a program, send (key) commands in response to the
programs pop-up windows and then close out the program (gracefully) no
matter what else may be going on with other applications or operating
system?
I'll keep looking and trying but if you have licked this problem yourself,
I'd like to read what you did.
Thank you,
Bob S.