Here is the current version of the batch file I have running today. So far it's been working perfectly. This is not for the faint at heart. You have to know a lot of the mechanic's in order to get this to work, especially batch files, email smtp, gmail etc, but once it's set up, it's working great.
What does it do:
Simply Put, it email's an audio file (MP3) of your Fire/EMS calls to an email address (your phone) so you always know what's going on in your town without having to carry a scanner, or being out of range.
Assumptions:
1. Make sure you are using ProScan 12.1 or above. Bob fixed a major issue with ProScan which was creating lots of ghost files with FTO recording. You have FTO set up and working on your scanner. (or not, if you leave the scanner on an open dispatch channel, it'll send everything ProScan records). If using FTO, select "each FTO in a new row" option
2. You have to have ProScan set up and connected to your scanner. I have a 536HP so I'm connected via wifi which makes it so easy.
3. If you use gmail as the sending service you have gone into gmail and set the email security to allow
3rd party sending (you have to research how to do this, I did it a long time ago for another project and
can't remember how, it was selecting security low or something similar), or having a an email service
that allows 3rd party sending
4. ProScan installed and set up correctly saving MP3 files at the location specified in the batch file (dSource)
5. cmail.exe located in the correct place (c:\recordings) and set to read only. If you don't set r/o flag it will get accidentally erased when the batch file has a empty value for a file name (which does happen)
If there is any interest from anybody in actually using this, I would be willing to write a little guide to make it easier to implement. I'm assuming nobody will actually run it, I'm always inventing things that only I use, but if you struggle with this, I'll write something up to make it easier to use.
6. you'll need to modify ProScan save audio file location and the batch file for the dSource and dTarget variables to locations that you chose. Mine are not optimal and eventually I'll clean them up, but I was heavy into debugging.
I've attached the batch file to make it a little easier. I have ProScan and the batch file running on my kitchen pc (built into the wall) which is always on. This is a great feature because it brings the scanner (which is upstairs) to my kitchen by virtue of running ProScan on that computer, but also gives me a platform to run the batch file 24/7. ProScan appears in the system tray and the batch file runs minimized.
Basically the batch file scans the dSource directory every minute looking for MP3 files (that ProScan would drop there when it records a fire/ems call). There is logic to delay processing if it detects that the file is still being written by ProScan (otherwise I was getting multiple emails with parts of the same call). It then moves the MP3 to another directory dTarget and then deletes it from it's original location. It then emails the file to a particular recipient configured in the cmail command line (google cmail.exe for complete syntax) then deletes the MP3. It waits a minute then continues looking for MP3 files to send. I'm no code guru so I'm sure you could tear my logic apart from a coding perspective, but it works...
Forum won't let me upload cmail.exe so here's the link:
https://www.inveigle.net/CMail_0.7.9b.zip
@echo off
cls
c:
cd \recordings
:start
set dSource=C:\Users\pc\Documents\Recordings\
set dTarget=c:\recordings
set fType=*.mp3
for /f "delims=" %%f in ('dir /a-d /b /s "%dSource%\%fType%" 2^>nul') do (
2>nul (
>>"%%f" echo off
) && (copy /V "%%f" "%dTarget%\") || (goto delay)
del "%%f" > nul
)
IF EXIST *.mp3 (
dir *.mp3 /b > tmp
set /p VAR=<tmp
del tmp
cmail -host:your_gmail_account_here.com:your_gmail_password_here@smtp.gmail.com[/email]:587 -starttls -to:recipient_email_user_here.com -from:FIRE/EMS@home.com "-subject:FIRE/EMS Alert" "-body:See attached" "-a:%VAR%"
echo Sent:%VAR%
del /Q "%VAR%"
goto start
) ELSE (
echo No Work at %time% - Waiting
ping 1.1.1.1 -n 1 -w 60000 > nul
goto start
)
:delay
echo ProScan is Still Writing File - Delay
ping 1.1.1.1 -n 1 -w 10000 > nul
goto start
Let me know if you have any questions.
Roveer