| View previous topic :: View next topic |
| Author |
Message |
iblamemicrosoft@gmail.com Guest
|
Posted: Sat Aug 27, 2005 11:40 am Post subject: Batch file params |
|
|
I know how in html files you can simply go:
<param name="number" value="1">
but how can you replicate this in a batch file? Any help would be
appreciated.
|
|
| Back to top |
|
 |
Andrew Thompson Guest
|
Posted: Sat Aug 27, 2005 12:01 pm Post subject: Re: Batch file params |
|
|
On 27 Aug 2005 04:40:52 -0700, [email]iblamemicrosoft (AT) gmail (DOT) com[/email] wrote:
| Quote: | I know how in html files you can simply go:
param name="number" value="1"
|
For an applet? Yes.
| Quote: | but how can you replicate this in a batch file?
|
For an applet? You can't (at least not easily).
For an application, you can provide arguments on the
command line when you invoke Java, like..
java TheMainClass arg1 arg2 arg3
For more information on the 'java' command, check the JavaDocs
<http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html#synopsis>
Once you can start your Java application from the command
line. You can put that command in a .bat file and it should
work just fine to launch your application with the arguments
at the end of the 'java' command.
HTH
--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Come on boys, let's push it hard.."
P.J. Harvey 'Victory'
|
|
| Back to top |
|
 |
Andrew Thompson Guest
|
Posted: Sat Aug 27, 2005 1:12 pm Post subject: Re: Batch file params |
|
|
On Sat, 27 Aug 2005 13:51:40 +0100, Thomas Hawtin wrote:
| Quote: | java -Dnumber=1 -jar MyApp
String number = System.getProperty("number");
|
Good point Thomas. There are better ways to do what
the OP requires. And properties (for one) more closely
fits the requirements in being able to tie values to names.
I always consider it rather fragile to depend on a
certain parameter order using the 'args' (as I
demonstrated initially).
--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"..When after all, it was you and me."
The Rolling Stones 'Sympathy For The Devil'
|
|
| Back to top |
|
 |
Roedy Green Guest
|
Posted: Mon Aug 29, 2005 9:49 pm Post subject: Re: Batch file params |
|
|
On 27 Aug 2005 04:40:52 -0700, [email]iblamemicrosoft (AT) gmail (DOT) com[/email] wrote or
quoted :
| Quote: | but how can you replicate this in a batch file? Any help would be
appreciated.
|
You can set parms in the environment or set system parms on the
command line.
See http://mindprod.com/jgloss/set.html
http://mindprod.com/jgloss/properties.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
|
|
| Back to top |
|
 |
|