Automatically close the DOS Command Shell window (after last line)?

Home Forums Scripting DOS Command Shell Automatically close the DOS Command Shell window (after last line)?

This topic contains 2 replies, has 3 voices, and was last updated by  Kasi77 1 year, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • dreivilo47
    dreivilo47
    Participant
    #167233

    I have a batch file named “test.cmd”.

    The file contains 1 line:
    “C:Testtest.txt”

    The goal is to open the file “C:Testtest.txt”, that’s working.
    But the DOS Command Shell window remains open until I close the txt-file manually.

    So, my question is: How to automatically close the DOS Command Shell window after opening “C:Testtest.txt”?


    Rems
    Moderator
    #228477

    The batch is waiting for the exit code, therefore it wait for it to terminate. If you don’t want the batch to wait use the START command.

    @start “” “C:Testtest.txt”
    !!! mind the quotes before the path. The START command assumes that the first text between quotes in the command line is the TITLE, so if the path is between quotes you’ll have to add text between quotes to the command line before the path.


    Kasi77
    Member
    #391873
    Rems;n513920 wrote:
    The batch is waiting for the exit code, therefore it wait for it to terminate. If you don’t want the batch to wait use the START command.

    @start “” “C:Testtest.txt”
    !!! mind the quotes before the path. The START command assumes that the first text between quotes in the command line is the TITLE, so if the path is between quotes you’ll have to add text between quotes to the command line before the path.

    Thank you for your reply and for the solution [USER=”2530″]Rems[/USER]!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.