Access with CMD.EXE

G

Guest

Right now, I have an access macro scheduled to run on Windows Task Scheduler.
I would like to include something in that macro that will give me an
indication of the status of the scheduled task. This sounds trivial except
that the scheduled task / macro will be running on another PC. So, I was
thinking about making some code in the macro that will say something like:

if the scheduled task ran, then NET SEND ME "Ran fine" else
NET SEND ME "did not run fine"

Anybody ever done anything like this before? Thanks!
 
L

Larry Linson

Mark1 said:
Right now, I have an access macro scheduled to run on Windows Task
Scheduler.
I would like to include something in that macro that will give me an
indication of the status of the scheduled task. This sounds trivial
except
that the scheduled task / macro will be running on another PC. So, I was
thinking about making some code in the macro that will say something like:

if the scheduled task ran, then NET SEND ME "Ran fine" else
NET SEND ME "did not run fine"

Anybody ever done anything like this before? Thanks!

http://www.mvps.org/access/modules/mdl0019.htm contains information on
sending e-mail from an Access application -- that would likely be more
accurate information than you could obtain from the Task Scheduler --
although the article is for an earlier version, the capability continues to
exist in later versions of Outlook. It will, of course, require that the
necessary mail software be installed on the machine where your Access
database is run.

As I haven't done macros in years (primarily because they haven't included
error handling, but also because VBA code is more powerful), I can't speak
with authority, but I believe this is a bit too much to accomplish in a
macro.

You can also search the archives at http://groups.google.com of this
newsgroup and the USENET newsgroup comp.datbases.msaccess for posts on
sending e-mail from Access.

Larry Linson
Microsoft Access MVP
 
G

Guest

Unfortunately, my company doesn't use Outlook (I wish it did, it would make
things soooo much easier). So, I really want a way for a module to open up
CMD.exe and do NET SEND ME "This macro has run".

I've gotten as far as the SHELL function
SHELL("CMD.EXE")
but I don't know how to get the module to write NET SEND ME "This ran fine"
after the C:\ prompt.
 
G

Guest

I finally got it. All I did was do a RUNAPP in my macro and in the
command-line typed NET SEND ME "This is cool" and it worked!!! I can't
believe it.
 
L

Larry Linson

Mark1 said:
I finally got it. All I did was do a RUNAPP in my
macro and in the command-line typed NET SEND ME
"This is cool" and it worked!!! I can't believe it.

I'm glad you found the solution... I'm sorry I misunderstood and thought you
wanted to send the message from the Scheduler.

Larry Linson
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top