Single Instance

  • jsherk

    jsherk - 2010-07-05


    I use WinSize2 (v2.30.01) on Win XP Pro SP3 and I love it (use it mostly with PuTTY). I use a batch file to start it with certain program, but if it is already running, it says:
    An older instance of this script is already running. Replace it with instance? Note: To avoid this message, see #SingleInstance in help file.

    I have read thru the pdf file, but cannot find any reference to SingleInstance anywhere.. is there a way to remove the above message and only run as single instance?


  • jsherk

    jsherk - 2010-07-05

    Sorry, actually using v2.33.02 … the ini file says 2.30.01 though.

  • Magra

    Magra - 2010-07-05

    This has been a problem in earlier versions.

    To get rid of this:
    - close WS2
    - edit the WinSize2_Root.INI in the Magrasoft-directory
    - delete the line: "Process_ID=…"
    - and start WS2 again.

  • jsherk

    jsherk - 2010-07-06

    Ok, following your instructions, I shut down ws2 and then I went to:
    C:\Documents and Settings\myusername\Application Data\MagraSoft
    and removed the Process_ID= line

    When I start it up again (the first instance), a new Process_ID= line is written into the file, and if I try to start a second instance, the same "An older instance of this script is already running. Replace it with instance?" comes up again.


  • Magra

    Magra - 2010-07-06

    >> "An older instance of this script is already running."

    This is a (wanted) message from the Autohotkey-Runtime system. I don't see a reason why you would start WS2 a second time.

    Of cause you can use the command-line calls "winsize2 renametitle …" (chapter 4.5) when WS2 is loaded.

  • jsherk

    jsherk - 2010-07-06

    The reason it gets started a second time, is because I only use it with specific programs, and do not load it at startup, so I have a batch file that looks like this:
    start "winsize2.bat" "C:\Program Files\WinSize2\WinSize2.exe"
    start "putty.bat" "C:\Program Files\PuTTY\putty.exe"

    So everytime I click my shortcut to putty, it will try to start WinSize2.

    But, I have solved the problem by re-writting my batch file to see if WinSize2 is running first, like this:

    REM Check if WinSize2 is running before starting PuTTY
    REM Need to downloand pv.exe and put it in C:\windows\system32
    REM Download from here: 
    pv.exe WinSize2.exe >nul
    if ERRORLEVEL 1 goto Process_NotFound
    REM If the process is already running, then don't do anything.
    goto END
    REM If the process is NOT running, then start it.
    start "winsize2.bat" "C:\Program Files\WinSize2\WinSize2.exe"
    goto END
    REM Start PuTTY
    start "putty.bat" "C:\Program Files\PuTTY\putty.exe"
  • Magra

    Magra - 2010-07-07

    This - of cause - is possible.

    Let me remark that WinSize2 was optimized to use little CPU power only, so it may be easier to start it up at login without loosing too much efficiency. Or you will have to write one CMD for each utility where you want to use WS2.

    A second remark: pslist.exe from does the same as pv.exe and is described well.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks