mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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(...)

Last edited by pouncer; 25/12/09 01:18 AM.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You should be able to pipe the output into a file:

Code:

/run command param1 param2 param3 > output.txt


(untested)

-genius_at_work

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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.

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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

Last edited by pouncer; 25/12/09 09:10 PM.
Joined: Dec 2008
Posts: 95
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2008
Posts: 95
http://www.kthx.net/clb/exec/

Been using it for the rsa_respond tool.

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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.


Link Copied to Clipboard