A .bat is a text file where commands can be written to be executed by DOS interpreter (I've never teste a .bat file in Unix/Linux). Which commands can we insert? Standard DOS commands, file names and the path variable contents.
Example:
Suppose in your current work directory the file Register.java that prints a register and we want to compile it, execute it, redericting the out to "out.txt" and at last open it. Instead of doing this manually we can create the test.bat with the following content.
javac Register.java
java Register > out.txt
out.txt
---END---Don't include this line in your file.
When the test.bat is double clicked or runned by command line the above tasks will be done. We have increased the productivity
We can use to simulate a Java executable. Only write the command in the .bat file.
java ClassName
This is not like a executable solution but it is better than write commands to the interpreter.
Sunday, March 29, 2009
Subscribe to:
Posts (Atom)