So, I was just curious. How would I create a batch file that ran a command when I opened it (or double clicked it)?
For instance, I want the command line to execute:
>javac *.java
Batch Files
Moderator: MaxCoderz Staff
Re: Batch Files
open notepad, type in the commands and save it but put .bat as the extension when you save it
- benryves
- Maxcoderz Staff
- Posts: 3089
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
Re: Batch Files
Or, assuming Windows, give it an extension of .cmd
Re: Batch Files
For larger projects, you might want to look into makefiles. Makefiles allow you to easily compile only the source files that were altered since the last compilation, instead of recompiling all source files every time. I don't know if they're double-clickable, though
Re: Batch Files
Okay, but what if I want to use the command:
java MakeChange
and the program MakeChange uses the command line?
I tried putting the command in a .cmd file (it works for .bat too), but it keeps running the command over and over again, infinitely...
java MakeChange
and the program MakeChange uses the command line?
I tried putting the command in a .cmd file (it works for .bat too), but it keeps running the command over and over again, infinitely...