Batch files to run Log4OM and other digi programs

General discussions V2
Post Reply
kd7mw
Advanced Class
Posts: 41
Joined: 10 Feb 2018, 06:03

Batch files to run Log4OM and other digi programs

Post by kd7mw »

Below are two Windows batch files (aka CMD scripts) that I use to start Log4OM and my favorite digital radio programs. Each script starts out with a test to see if it is running as Administrator, by attempting to copy a "flag" file to the Log4OM program directory. If it can't, you're not running as Administrator, and the script tells you so and quits. If you are, then it checks to see if each program is already running. If not, it runs the program, with an appropriate time delay before starting the next one. Since the CMD box is running as Administrator, the programs it spawns are also running elevated.

Back in the Log4OM v.1 days, I had to use a second Log4OM fldigi configuration and even more programs running. I found it very convenient to have these scripts to load the "stack" of programs, and only run what was missing if I had to tweak something. Now, with the two-cable "Icom 7300" solution, things are easier. But it's still nice to be able to right-click on one icon, tell it to "Run as Administrator," and everything I need gets done. If I have to close a program and reload, the script does it, only reloading what's needed. Very helpful when you're trying to work that once-in-a-lifetime DXpedition to Seal Scat Island, and WSJT-X crashes.

If you use these scripts, you will have to modify the paths and "timeout" delays to match your computer. The --CONFIG: parameter is needed only if you have multiple Log4OM configurations, and obviously, you'll have to use the GUID for your specific configuration. No warrantee, no support, your milage may vary, batteries not included. That said, I'm happy to share these with the Log4OM community, with thanks for all the help I've received here.

--- Here's the WSJT/JTalert script ----------------------------

:: StartWSJTandJTAlert-RunAsAdmin.bat (normal Log4OM OmniRig config)
:: Log4OM NextGen (V2)
:: Peter Klein, KD7MW, Sept. 2020

@echo off
echo.
copy /y C:\Users\peter\Desktop\HamDigi\_flagXYZ.txt "C:\Program Files (x86)\IW3HMH\Log4OM NextGen" >nul 2>&1
if errorlevel 1 echo This script must be run as Administrator. Please try again. & goto end

tasklist |find /i "L4ONG" >nul
if not errorlevel 1 echo Log4OM is already running. & goto skiplog
echo Starting Log4OM...
start "" "C:\Program Files (x86)\IW3HMH\Log4OM NextGen\L4ONG.exe" --CONFIG:593fbd69-c1d9-415c-94bd-5c5489735245 & timeout 25

:skiplog
tasklist |find /i "wsjt" >nul
if not errorlevel 1 echo WSJTx is already running.
if errorlevel 1 echo Starting WSJTx...
if errorlevel 1 start "" "C:\WSJT\wsjtx\bin\wsjtx.exe" & timeout 5

tasklist |find /i "jtalert" >nul
if not errorlevel 1 echo JTAltert is already running.
if errorlevel 1 echo Starting JTAlert...
If errorlevel 1 start "" "C:\Program Files (x86)\HamApps\JTAlert\JTAlert.exe" /wsjtx

:end
echo Press any key to end script.
pause >nul

--- Here's the fldigi script ----------------------------

:: StartFldigi-RunAsAdmin.bat (normal Log4OM OmniRig config)
:: Log4OM NextGen (V2)
:: Peter Klein, KD7MW, Sept. 2020

@echo off
echo.
copy /y C:\Users\peter\Desktop\HamDigi\_flagXYZ.txt "C:\Program Files (x86)\IW3HMH\Log4OM NextGen" >nul 2>&1
if errorlevel 1 echo This script must be run as Administrator. Please try again. & goto end

tasklist |find /i "L4ONG" >nul
if not errorlevel 1 echo Log4OM is already running. & goto skiplog
echo Starting Log4OM...
start "" "C:\Program Files (x86)\IW3HMH\Log4OM NextGen\L4ONG.exe" --CONFIG:593fbd69-c1d9-415c-94bd-5c5489735245 & timeout 25

:skiplog
tasklist |find /i "fldigi" >nul
if not errorlevel 1 echo fldigi is already running.
if errorlevel 1 echo Starting fldigi...
if errorlevel 1 echo Click ignore on any Assertion Error.
echo Confirm that the fldigi service is running in LOG4OM.
if errorlevel 1 start "" "C:\Program Files (x86)\Fldigi-4.1.13\fldigi.exe" & timeout 5

:end
echo Press any key to end script.
pause >nul
Post Reply