Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

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 👍

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/fce0bc9e464d26479f0b4499619d19c2.txt
  • Last modified: 2024/12/10 16:16
  • by 127.0.0.1