How to make .bat file close itself automatically?

Discussion in 'Scripting' started by MonarchX, Sep 17, 2015.

  1. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,732
    313
    60
    I was not sure where to ask this, but I figured .bat files are a part of the OS, so this would be a good place. This is what I have in .bat file so far:

    I need this .bat to auto-close after it is done running that command. i also tried "@exit" as the last line, but it just won't auto-close, which is what I need!
     
  2. jmtella

    jmtella MDL Senior Member

    Nov 18, 2012
    260
    155
    10
    #2 jmtella, Sep 17, 2015
    Last edited by a moderator: Apr 20, 2017
    Code:
    
    @echo off
     start  C:\Users"XXX"\Apps\TimerTool\TimerTool.exe -t 0.5 -minimized
    
    
     
  3. KNARZ

    KNARZ MDL Addicted

    Oct 9, 2012
    895
    482
    30
    your timer tool holds the window open.

    use this line..

    start /b "Some Title" "C:\Users"XXX"\Apps\TimerTool\TimerTool.exe" -t 0.5 -minimized

    /b means don't wait for process
    the some title or "" are needed as if the first parameter should be the command but has space in it... the command will fail... therefore always give a title and than you dont have to worry.