Windows 10: Automatically close CMD window after .bat file finishes?

Discus and support Automatically close CMD window after .bat file finishes? in Windows 10 Ask Insider to solve the problem; I've got a little batch file I use to open two programs with one shortcut, and while it works, the CMD window remains open until I manually close it.... Discussion in 'Windows 10 Ask Insider' started by /u/NostalgiaSchmaltz, Aug 29, 2020.

  1. Automatically close CMD window after .bat file finishes?


    I've got a little batch file I use to open two programs with one shortcut, and while it works, the CMD window remains open until I manually close it. There is an "exit" at the end, and I've googled for solutions for this but none of them worked.

    @Echo off cd C:\Program Files\Adobe\Adobe After Effects 2020\Support Files start AfterFX.exe cd C:\Program Files\Adobe\Adobe Media Encoder 2020 "Adobe Media Encoder.exe" exit

    It opens both programs, but then the CMD window just stays there and doesn't close unless I close it manually.

    submitted by /u/NostalgiaSchmaltz
    [link] [comments]

    :)
     
    /u/NostalgiaSchmaltz, Aug 29, 2020
    #1
  2. Martmcd Win User

    .bat files

    it depends a little on what the batch file is doing, running from within windows it will open a cmd prompt run the commands and close the command prompt.

    outputs from the commands (including errors) are lost when the batch file finishes and closes the command prompt.

    if it is trying to run something that requires admin privileges, it will simply produce an error that is lost.

    if you are running from a shortcut try cmd /k batchfile.bat
    that should leave the command prompt open when the batchfile terminates
     
    Martmcd, Aug 29, 2020
    #2
  3. sc00VN Win User
    .bat file

    A batch file (.bat extension) is basically a series of commands to be executed by the command-line interpreter. When you open the file, your system runs every command stored in the file from top to bottom, once the final command has been executed, it closes
    itself indicating it has finished its job. However, everything happens so fast you think it closes immediately and that's completely normal.

    If you want the command-line interpreter window to remains open once the last command has been executed, I suggest you do the following:

    - Right click on the .bat file and click on the 'edit' button.

    - It will open a notepad displaying a series of commands.

    - Create a new line by hitting enter after the final text and type in 'pause' without quotes.

    - Save the file and run it. This time the window will remain open.
     
    sc00VN, Aug 29, 2020
    #3
  4. Kotabug Win User

    Automatically close CMD window after .bat file finishes?

    My Batch File(.bat) is no longer running CMD

    My Batch File(.bat) is no longer running CMD and when i go and change the program and find CMD and or Command Prompt it says that the program that i chose cannot be associated with this file type. Please choose another. I ran CMD with .bat file before, but
    now i can't. I there a solution to this, please?

    Original Title: Set Associations
     
    Kotabug, Aug 29, 2020
    #4
Thema:

Automatically close CMD window after .bat file finishes?

Loading...
  1. Automatically close CMD window after .bat file finishes? - Similar Threads - Automatically close CMD

  2. Bat or Cmd file not running at login

    in Windows 10 Gaming
    Bat or Cmd file not running at login: This should be an easy one. Created a net use map drive batch file, also as a cmd. Either one not both, just as a troubleshooting step. File is located on my desktop and if I double click on it, either one it executes as expected and maps the drives. 1st approach was a...
  3. Bat or Cmd file not running at login

    in Windows 10 Software and Apps
    Bat or Cmd file not running at login: This should be an easy one. Created a net use map drive batch file, also as a cmd. Either one not both, just as a troubleshooting step. File is located on my desktop and if I double click on it, either one it executes as expected and maps the drives. 1st approach was a...
  4. 'net use' works in cmd window, not in .bat file

    in Windows 10 Network and Sharing
    'net use' works in cmd window, not in .bat file: Win10 Pro, Version 2004, build 19041.804 (Suggestion to Microsoft- put a 'copy to clipboard' button on the WinVer window). On my home network I have some servers and a couple of NAS drives. (Eight altogether). In startup I call a batch file to map them using 'net use'. Most...
  5. Bat file automatically close?

    in Windows 10 Support
    Bat file automatically close?: when i execute the bat file i get a window this window should be closed after 5 seconds if no interaction with the window was done Does anybody know how to do this? Bat Datei automatisch schließen?
  6. Pin .cmd/bat files to taskbar

    in Windows 10 Ask Insider
    Pin .cmd/bat files to taskbar: Some UWP apps look very out of place on my taskbar and I wanted to change the icons. The only way I found looking instead of editing in MS Visual Studio was to make a run command and that opens the app. However, I can't pin it to the taskbar. I tried .bat but that didn't work...
  7. Need some Help with CMD and .bat files

    in Windows 10 Ask Insider
    Need some Help with CMD and .bat files: I have .bat file thats in a folder in my desktop (location). When i open the bat file i need it to run in the folder that's it's located (in the folder thats on my desktop) However, when i run the bat file it runs at the default location. So isn't there anyway I can change...
  8. Executing a .bat file on CMD

    in Windows 10 Support
    Executing a .bat file on CMD: Hello all, For a programming process we need to execute a .bat file from CMD. I'm on Windows 10 x64. When I paste the path to the file and hit Enter, the message below is expected to show up: Setting up environment for Qt usage... It happened a time and when we wanted to...
  9. Executing the bat file without showing the cmd window?

    in Windows 10 Support
    Executing the bat file without showing the cmd window?: I have a bat file closing a program - Digital Clock close.bat - containing: Code: taskkill /F /IM digital_clock.exe[/quote] How could I avoid this window to be opened when executing the bat file: [img] 92109
  10. I can no longer run bat file as Admin (cmd flickers then closes)

    in Windows 10 Support
    I can no longer run bat file as Admin (cmd flickers then closes): I made a working script for my windows to mount and unmount drives and it works but it requires admin permission. right after i made the script i saved it and test it and it was working fine, i tested it about 15 times and it works. then i reboot and the script no longer...

Users found this page by searching for:

  1. Auto close CMD window windows 10

    ,
  2. close bat file after execution exit doesnt show