Windows 10: Bat file closing immediately when opened when big text put in

Discus and support Bat file closing immediately when opened when big text put in in Windows 10 Software and Apps to solve the problem; I am attempting to create a simple batch file that contains text. When I use a short line like "hello," it works as expected. However, when I input a... Discussion in 'Windows 10 Software and Apps' started by fiery pony67, Mar 7, 2025.

  1. Bat file closing immediately when opened when big text put in


    I am attempting to create a simple batch file that contains text. When I use a short line like "hello," it works as expected. However, when I input a larger block of text, the window closes immediately.In summary:Small text works fine.Larger text causes the window to close instantly. I am very new to this kind of stuff so I'm sorry if this is a easy fix.

    :)
     
    fiery pony67, Mar 7, 2025
    #1
  2. 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, Mar 7, 2025
    #2
  3. .jar files open and close immediately

    Hello RYAN71098,

    1. Reinstall or update Java Runtime Environment

    If you can’t run jar files on your Windows 10 PC, you might need to reinstall Java Runtime Environment. To do that, follow these steps:

    Press Windows Key + I to open the Settings app.

    When the Settings app opens, go to the System section. Now, choose Apps & features from the left pane.

    Locate Java from the list and choose the Uninstall option.

    After doing that, navigate to Java’s website and download the latest version of the software. Once installed, check if the problem is resolved.

    Java will also automatically check for updates, and if updates are available you’ll get a notification. To update Java, simply click the notification and choose the Update option. Now follow the instructions to complete the update.

    2. Set file association

    Jar files can’t run on your PC if you don’t have the proper associations. For example, jar files can be associated to run with other applications or they could lack file association completely.

    If the situation is the latter one, you won’t be able to run jar files on your PC. However, you can easily fix this problem by changing the file association for jar files. To do that, follow these steps:

    Open the Settings app. Navigate to the System > Default apps.

    Scroll all the way down and select Choose default apps by file type.

    Locate the .jar file type and choose a default application.

    3. Create a .bat file

    According to users, you can run jar files on Windows 10 by using this simple workaround. This solution requires you to create a .bat file and use it every time you want to run a specific jar file. The process is rather simple and you can do it by following
    these steps:

    Locate your jar file. In the same folder, create a new Notepad file. To do that, right-click empty space in the directory and choose New > Text Document.

    When Notepad opens, enter java -jar filename.jar. Be sure to replace filename.jar with the actual name of the file.

    Navigate to the File > Save as.

    Set Save as type to All files. Now, enter the desired name for the file. Keep in mind that you need to have .bat as an extension or else the solution won’t work. Save the file in the same location where your jar file is located.

    After doing that, locate your .bat file and double-click it. Your jar file will now open. Keep in mind that you need to repeat this process for every jar file that you want to run on your PC. In addition, be sure to save the .bat file in the same location as
    your jar file.

    Hope it helps, have a good day
     
    ManuelCapiro, Mar 7, 2025
    #3
  4. Bat file closing immediately when opened when big text put in

    cant open .bat file

    Please open command line windows, run bat file from command line and show the result (command window).

    And please type a text of bat file.
     
    Igor Leyko, Mar 7, 2025
    #4
Thema:

Bat file closing immediately when opened when big text put in

Loading...
  1. Bat file closing immediately when opened when big text put in - Similar Threads - Bat file closing

  2. Bat file closing immediately when opened when big text put in

    in Windows 10 Gaming
    Bat file closing immediately when opened when big text put in: I am attempting to create a simple batch file that contains text. When I use a short line like "hello," it works as expected. However, when I input a larger block of text, the window closes immediately.In summary:Small text works fine.Larger text causes the window to close...
  3. Notepad open new tab not working when opening a .bat file

    in Windows 10 Software and Apps
    Notepad open new tab not working when opening a .bat file: When I try to edit a bat file using notepad the notepad is open in a new window instead of a new tab and when I open the notepad app it opens two windows one with the bat file and one with my previous tabs....
  4. Start menu closes immediately when open

    in Windows 10 Gaming
    Start menu closes immediately when open: When I click or press the shortcut key the start menu closes immediately. It only flashes for second and does nothing. I tried restarting the PC but still wont make it. This issue only occurs after I perform system restore on the device for different concern....
  5. Start menu closes immediately when open

    in Windows 10 Software and Apps
    Start menu closes immediately when open: When I click or press the shortcut key the start menu closes immediately. It only flashes for second and does nothing. I tried restarting the PC but still wont make it. This issue only occurs after I perform system restore on the device for different concern....
  6. Start menu closes immediately when open

    in Windows 10 Customization
    Start menu closes immediately when open: When I click or press the shortcut key the start menu closes immediately. It only flashes for second and does nothing. I tried restarting the PC but still wont make it. This issue only occurs after I perform system restore on the device for different concern....
  7. When I put the laptop to sleep, and THEN close the lid, it wakes up immediately.

    in Windows 10 Gaming
    When I put the laptop to sleep, and THEN close the lid, it wakes up immediately.: I want the laptop to stay awake when I close the lid, so I can listen to Spotify with the lid closed. So I have the option set to "Do nothing" for when I close the lid. I press the power button to put the device to sleep. It goes to sleep. Then I close the lid, it wakes up...
  8. When I put the laptop to sleep, and THEN close the lid, it wakes up immediately.

    in Windows 10 Software and Apps
    When I put the laptop to sleep, and THEN close the lid, it wakes up immediately.: I want the laptop to stay awake when I close the lid, so I can listen to Spotify with the lid closed. So I have the option set to "Do nothing" for when I close the lid. I press the power button to put the device to sleep. It goes to sleep. Then I close the lid, it wakes up...
  9. .jar files open and close immediately

    in Windows 10 Network and Sharing
    .jar files open and close immediately: I'm trying to download Minecraft forge, and It gives me a .jar file. I accidently set it to open with Photoshop, so I set it to open with Java, but when I try to open it, it opens, then closes immediately. When I try to force it open by clicking, it opens into cmd. I have the...
  10. WHEN OPENING A FILE FOLDER AND CLOSING IT

    in Windows 10 Network and Sharing
    WHEN OPENING A FILE FOLDER AND CLOSING IT: WHEN I OPEN A FILE FOLDER AND THEN SUCCESSIVE FOLDERS CONTAINED WITHIN THE FIRST ONE I FIND THAT IN ORDER TO CLOSE OUT I MUST CLOSE MULTIPLE FOLDERS. I WANT TO MAKE IT SO THAT I CAN CLOSE ONE FOLDER AND BE DONE WITH IT. I AM SEARCHING FOR A SETTING TO FIX THIS ISSUE....