Run small program every time prompt is displayed

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jan 16, 2010
1
0
#1
I use the command line a lot and I want to run a small command line program that will check my email every time the prompt is printed.

Is there any way to do this?

Thanks

Mark
 
#3
Mark S:
| I use the command line a lot and I want to run a small command line
| program that will check my email every time the prompt is printed.
|
| Is there any way to do this?

Rod Savard:
| Check out the PRE_INPUT alias. Alternatively you could add an
| %@EXEC to your PROMPT variable, but I think PRE_INPUT is better.

PRE_INPUT is performed after the PROMPT variable is used to place
the command line prompt on the screen, thus it is the latest possible
opportunity to generate a "new mail" message. However, none of the
possible methods detects new mail received AFTER the alias PRE_INPUT
is executed, and TCC is just waiting for the next command to be
entered.
If you use TCC and not TCC/LE, you can also use the FOLDERMONITOR
command to display a MSGBOX when any file in the folder containing
your emails is "modified". Probably will need a batch file to make
your report if your mail client is like Outlook Express, which
updates modification times even when no new mail is actually
received, so that you would need to save the filesize each time it is
triggered, and use its changes to detect actual email. If you use
message rules, you may need to make a lot more checks.
--
HTH, Steve
 
May 26, 2008
481
3
#4
Good point, Steve! I use PRE_INPUT to do something each time a prompt is displayed but it's to modify the title bar with the current working directory.