mIRC Homepage
I currently run a java class via mirc, like this:

RUN java SomeJavaClass param1 param2etc

how can i get the contents of the cmd window? as the java program just prints the output to the window via System.out.println(...)
You should be able to pipe the output into a file:

Code:

/run command param1 param2 param3 > output.txt


(untested)

-genius_at_work
I wanted to avoid writing contents to text files and then reading from text files. But if there is no other way then I guess I have to do it like that.
Originally Posted By: genius_at_work
You should be able to pipe the output into a file:

Code:

/run command param1 param2 param3 > output.txt


(untested)

-genius_at_work


Nope that didn't seem to work, couldnt get it to output into the file.

My curent dirty workaround is having the java class write the contents to a textfile. and then when i make mirc run the command, i read the textfile after 1 second

Code:
	public static void main(String[] args) {
		String outputFile = args[0], challenge = args[1];
		String response = generateChallenge(challenge);
		
		System.out.println(response);
		
		FileOutputStream fout;
		
		try
		{
		    fout = new FileOutputStream (outputFile);
		    new PrintStream(fout).println (response);
		    fout.close();		
		}
		catch (IOException e)
		{
		}
	}


notice my run command uses a java class.. so your run command you posted would make > output.txt - my java class would think they are parameters which is not what i want
http://www.kthx.net/clb/exec/

Been using it for the rsa_respond tool.
Originally Posted By: asdfasdf
http://www.kthx.net/clb/exec/

Been using it for the rsa_respond tool.


Hmm, interesting. Will have a look, thanks.
© mIRC Discussion Forums