Event in batch file?

Aug 28, 2006 10 Replies

Hi all.



I want to have a simple batch file that opens QuickBooks, then FTP's the QB data file to a server. No big deal, but I want the FTP transfer to occur AFTER QuickBooks is closed. How do I trigger an event only when closing an application?



Thanks.



The QB SDK has a feature called UIEventSubscription. One of the events to which you can subscribe is CompanyFileEventOperation. Your application will receive notification when a company file is Opened and Closed.

If you don't have the SDK, get it at:

formatting link
There are forums there as well for SDK questions.

More... obviously a batch file alone will not handle this. You will need to write an SDK capable application.

QBFTP.BAT

(command to invoke QB) (command to invoke FTP) EXIT

(command to invoke QB) (command to invoke FTP) cls echo Another fine job done by the kid. Pause EXIT

Unfortunately, QB does not behave as expected; the command following it in the batch file executes immediately, without regard to QB's state.

The answer, from another forum, provides the desired response (clearly thought through and tested before replying):

*******************************************************************************

"C:\Program Files\Intuit\QuickBooks 2006\QBW32PremierProfessional.exe" :again TaskList | find /i "qbw32.exe" > nul || goto continue goto again :continue ftp -s:"your script here" "FTP address here"

*******************************************************************************

Thanks.

What kind of script is this? What type of file is it contained in?

*******************************************************************************

This is a simple batch file which:

Launches QuickBooks Monitors QB's status (whether open or closed), and When closed, launches the WIndows FTP client (which then calls a script of commands to run on the corresponding FTP Server)

Jeff

*******************************************************************************

Jeff you did not answer the question. What kind of script is this? What type of file is it contained in?

It is certainly not a DOS batch file.

*******************************************************************************

Sure it is. What makes you thinks it's not a regular DOS batch file?

*******************************************************************************

It is indeed. Have you even tried it?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required