Stop second run OI9 (OpenInsight 64-bit)
At 27 SEP 2023 06:18:02PM Barry Stevens wrote:
How do I stop a second run of oi9 loading on a PC
At 27 SEP 2023 08:02PM bob carten wrote:
I often use a batch file to launch oi, and set the desktop shortcut to launch the batch file.
The batch file looks at the list of running tasks to see if there is already a process named oinsight.exe
@echo off :: Title -OpenInsight Launcher :: This what is said if it's not running set TESTSTR=INFO: No tasks are running which match the specified criteria. set /A NOTRUNNING=0 :: Iterate over all of the lines produced by the command. for /F "delims=" %%a in ('tasklist /fi "IMAGENAME eq oinsight.exe"') do ( :: If a line matches the test string, then the program isn't running. if "%%a"=="%TESTSTR%" ( set /A NOTRUNNING=1 ) ) if %NOTRUNNING%==1 ( start .\OInsight.exe /ap=MYAPP /un=%USERNAME% ) else ( start cmd /c "echo Opensight is already running && pause >nul" )
At 28 SEP 2023 02:26AM Barry Stevens wrote:
I often use a batch file to launch oi, and set the desktop shortcut to launch the batch file.
The batch file looks at the list of running tasks to see if there is already a process named oinsight.exe
@echo off :: Title -OpenInsight Launcher :: This what is said if it's not running set TESTSTR=INFO: No tasks are running which match the specified criteria. set /A NOTRUNNING=0 :: Iterate over all of the lines produced by the command. for /F "delims=" %%a in ('tasklist /fi "IMAGENAME eq oinsight.exe"') do ( :: If a line matches the test string, then the program isn't running. if "%%a"=="%TESTSTR%" ( set /A NOTRUNNING=1 ) ) if %NOTRUNNING%==1 ( start .\OInsight.exe /ap=MYAPP /un=%USERNAME% ) else ( start cmd /c "echo Opensight is already running && pause >nul" )Thanks 👍