Link to home
Start Free TrialLog in
Avatar of louy
louy

asked on

Running another VB program from VB

I am building a system monitoring application. It looks at certain files to see if their date/time stamps are changing.  ( To see if they are locked up).  It also counts files in directories and checks the oldest time stamp and reports problems through alphanumeric paging. It also needs to run some maintenance on its data each day (Clearing some counters and logs).  Eventually it will be running some scripts to dial into individual modems to see if they are operational.

I want to run this maintenance against the database and the dial out scripts which will be written in VB code from within my application.  I want to pass paramaters to them and return results.  I think that I would rather not have them be functions or sub's within my application because I would like to have the ability to kick off other programs from my application at defined intervals, while passing paramaters.  I am pretty new to VB.  Should I create these as DLL's, ActiveX components or something else.

Please be specific and provide some example code.
Avatar of mark2150
mark2150

Just build your maintenance programs as separate .EXE files and run them as you would any other task. This allows you to build components that can run stand-alone (and can be *tested* in that mode) and then just spawn them off like any other windows app.

M

Avatar of louy

ASKER

How do I pass paramaters and return results and how exactly do I run them from within my VB application.  Please provide some code.
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of louy

ASKER

I want to use the ExecCmd, I tried it and it works well.  To pass the data back and forth should I just write to a text file from each .exe or should I use a table in my Access DB or is there a cleaner way?
Straight ASCII text file is simplest and cleanest. This also allows you to component test by creating fake files with EDIT. You can also review outputs the same way.

M