Thanks!!!
BTW, still, if you know how to eliminate the '"' from the arguments, please let me know.
Thanks!
Zvi
-----Original Message-----
From: Keith Hatton [mailto:khatton@axiomsystems.com]
Sent: Monday, July 21, 2003 3:27 PM
To: Ant Users List
Subject: RE: Zvi_Q: invoking net send in windows
Hi Zvi,
I do not think you can use "net send" as the executable.
"net" is the executable. "send" is the first argument.
I guess Ant is trying to be Windows-friendly by putting quotes around the executable when
it has space chars in it (e.g. "Program Files").
Hope this helps
Keith
-----Original Message-----
From: Rahamim, Zvi (Zvi) ** CTR ** [mailto:rahamim@avaya.com]
Sent: 21 July 2003 13:24
To: Ant Users List
Subject: RE: Zvi_Q: invoking net send in windows
I'm using it from my java code:
public static int netSend(Task task, String user, String message){
Commandline commandLine = new Commandline();
commandLine.setExecutable("net send");
commandLine.createArgument().setValue(user);
commandLine.createArgument().setValue(message);
try {
Execute exe = new Execute(new LogStreamHandler(task, Project.MSG_INFO, Project.MSG_WARN));
exe.setAntRun(task.getProject());
exe.setWorkingDirectory(task.getProject().getBaseDir());
exe.setCommandline(commandLine.getCommandline());
return exe.execute();
} catch (java.io.IOException e) {
throw new BuildException(e, task.getLocation());
}
}
Zvi
-----Original Message-----
From: Keith Hatton [mailto:khatton@axiomsystems.com]
Sent: Monday, July 21, 2003 3:22 PM
To: Ant Users List
Subject: RE: Zvi_Q: invoking net send in windows
Hi Zvi,
Please post your XML so that we can take a look.
But, at a guess, check the difference between <arg line = ... > and <arg value =
... > - it may well give you what you need.
Keith
-----Original Message-----
From: Rahamim, Zvi (Zvi) ** CTR ** [mailto:rahamim@avaya.com]
Sent: 21 July 2003 13:20
To: Ant Users List
Subject: Zvi_Q: invoking net send in windows
Hi!
I want to execute the command:
net send user message
but when I execute it it executes:
"net send" user message
and therfore it fails!
How can I prevent it from addint the ' " '? (is there a way to prevent it from adding the
' " ' in the arguments even if they contains spaces?)
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
|