The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Autoclose batch file window

    Discussion in 'Windows OS and Software' started by SoundOf1HandClapping, Mar 24, 2012.

  1. SoundOf1HandClapping

    SoundOf1HandClapping Was once a Forge

    Reputations:
    2,360
    Messages:
    5,594
    Likes Received:
    16
    Trophy Points:
    206
    I use TightVNC to manage my servers, which are across the hallway.

    Anyhow, I downloaded their Java viewer and created a batch file. Script looks like this (with some names and numbers changed, of course)

    Code:
    @ECHO off
    set path=C:\Program Files\Diagnostics\TVNCJViewer\tightvnc-jviewer.jar
    tightvnc-jviewer.jar -jar -port=1234 forge.blargh.com
    exit
    
    The self-executing .jar files runs fine, with the correct port and URL. It prompts me for password, which I input, and boom, I'm in. However, I notice that the command window sticks around after I log in, despite the exit command.

    If I close the TVNC viewer window, the command window also closes. If I close the command window, the TVNC window remains open (which is good). So, what am I missing for the command window to close once I log in?


    The OS from the viewing computer is Win7 HP x64, if it makes any difference.
     
  2. SoundOf1HandClapping

    SoundOf1HandClapping Was once a Forge

    Reputations:
    2,360
    Messages:
    5,594
    Likes Received:
    16
    Trophy Points:
    206
    You know, never mind, haha. I went the Luddite way and just made shortcuts with the correct port and URL parameters.
     
  3. Syberia

    Syberia Notebook Deity

    Reputations:
    596
    Messages:
    1,611
    Likes Received:
    1
    Trophy Points:
    56
    Add "start" at the beginning of the line before you run the .jar file. Otherwise, the .bat will wait for the program to "finish," i.e. exit, before moving down to the exit command.