Open a .bat file

Solved
Hello,

I can't open a .bat file
when I click on it, the command prompt opens and closes very very quickly
how can I open it and what will I find in this type of file
thank you in advance

8 answers

  • Votes
  • Date
  • Descending date
  1. Contributor
    Hello,

    to open a batch file, right-click on it, then click on 'open with', and choose notepad.

    Best regards.
    --
    That guy wasn't too bright, because he was stupid.
    1. I right-clicked on it, but the context menu does not contain "open with"; it only has the open option.
      1. Hi, you need to right-click > Edit :) There you go, I hope I helped you.
        1. Thank you, I can open the file with Notepad
          but I want to execute it since the execution instructions indicate that the .bat file should be executed
          also, I cannot understand the code it contains
          here is the code:

          @echo off REM Should update the java path below
          java -Xmx256M -cp JInsect.jar;lib/openjgraph.jar gr.demokritos.iit.jinsect.gui.AutoSummENGGui

          thanks again
      2. or you can open Notepad and open the .bat file with it.
        If you want to see the execution result, add a line with the word pause at the end of the file.
        1. how to add the password (what should I write?)?????
      3. Once you have properly configured your environment variable, the content of the .bat file is used to compile the AutoSummENGGui.java class

        your file allocates 256MB of memory to the JVM and then loads the two jars JInsect.jar;lib/openjgraph.jar and compiles your AutoSummENGGui class

        @echo off REM Should update the java path below
        java -Xmx256M -cp JInsect.jar;lib/openjgraph.jar gr.demokritos.iit.jinsect.gui.AutoSummENGGui

        see the link:
        https://forums.commentcamarche.net/forum/affich-2143404-variable-d-environnement-java
        1. Thank you very much :) I solved my problem thanks to you.
        2. You're welcome.
        3. I didn't understand what you said

          answer quickly
      4. how to add the password (what should I write?)?????
        1. The password for what?
        2. It's for the response to "telliak".
        3. No, it's not a password but PAUSE

          it's to prevent the command prompt from closing once the commands in this bat file have been executed, and it allows seeing what it has done.
      5. I can open the file with Notepad as described by "nathom"
        but I don't understand the code it contains
        here is the code:

        @echo off
        REM Should update the java path below
        java -Xmx256M -cp JInsect.jar;lib/openjgraph.jar gr.demokritos.iit.jinsect.gui.AutoSummENGGui
        1. Contributor
          Hello,

          This .bat is intended to execute the "program" or rather the Java project contained in the JInsect.jar archive.

          To run it and see any messages related to its execution in the console, you need to go to Start / Run
          There, type cmd in the text box, then press [enter].
          A command window (pseudo DOS) opens, and you need to navigate to the directory where your .bat is stored on your PC.
          For example, if the command prompt displays C:\Documents and Settings\ellsamig>
          And the .bat is located under C:\Documents and Settings\ellsamig\Project\
          => You should type CD Project [Enter]
          Then, once you are in the right directory, simply type the name of your .bat file (without ".bat"), followed by the [enter] key.

          --

            (:*Þ   Pitù
          No way, not even close
          1. I did everything you said
            but the following message is displayed "offREM Should update the java path below
            offREM Should update the java path below
            java -Xmx256M -cp JInsect.jar;lib/openjgraph.jar gr.demokritos.iit.jinsect.gui.AutoSummENGGui
            'java' is not recognized as an internal or external command, operable program or batch file
            what's the problem???
            I have the JDK, JRE and JAVA virtual machine installed on my PC
          2. The problem in this case is that you haven't set the HAVA_HOME variable in the environment variables to point to the JDK (e.g., C:\Program Files\Java\jdk1.6.0_30).

            That's why when you type a -java command, it is not recognized by your system.

            Test in a command prompt >> java -version
            If you don't see something that looks like the text below, then your variable is not set:

            java version "1.6.0_30"
            Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
            Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
          3. you didn’t define in the variables envenomation: this envenomation of the environment delights me :-)))!
          4. thank you for the remark