mIRC Homepage

Getting output of /run

Posted By: MadMind

Getting output of /run - 11/01/03 07:39 PM

The /run program is useless if you want to get the output of a command line program and anything can't be done. I tried all posible and imposible variants.
It would be a good feature to get the output of command-line programs, not just using windows (DDE or DLL)
Posted By: MonoSex

Re: Getting output of /run - 11/01/03 09:10 PM

Maybe becouse /run is made for running a program, not getting it's output? smile
Posted By: Edward_K

Re: Getting output of /run - 11/01/03 10:51 PM

Create a batch file. Eg
@echo off
someprogram.exe > output.txt

Results are in the output.txt
Your script should create the batch file if needed
Posted By: codemastr

Re: Getting output of /run - 13/01/03 06:44 PM

/run terminates as soon as the program starts, if you have to wait for output it means mIRC will freeze until the child program terminates. This means that in theory mIRC could freeze indefinately if a program never terminates. Not a very good thing...
Posted By: Edward_K

Re: Getting output of /run - 14/01/03 01:33 AM

mIRC has never froze on me doing that. I use this method regularly, eg running user requested port scans via running nmap and returning the results. The scans could take hours and mirc keeps running along.
A test would be to type /run cmd.exe or /run command.com depending on your os. mirc should keep going while the command window is open.
Posted By: Necroman

Re: Getting output of /run - 14/01/03 07:07 AM

There was stdio.dll by DragonZap.
Posted By: Cobra

Re: Getting output of /run - 14/01/03 08:23 PM

just a misscommunication, you and codemaster are both correct. code was pointing out the condition where mirc has to wait for return output from a program, your method puts that task on the operating system instead of on mIRC.

in other examples where mirc is scaning, thats multipal processes one after anouther that continue to execute .. a loop .. its not a single task that can not move forward untill it gets output from anouther aplication or the user.

this is why mIRC does not alow you to use $$?="" in remotes because htat remote would then be paused untill the user inputed something, .. and considering sometimes i and many others can leave mirc runing for weeks on end being at the computer only off and on .. if your not there .. that means mirc would have to wait for u to return and inut somethign before it could move on.

however if mIRC was multithreded it would enable it to have a feature were it could posibly get return output from /run

Posted By: MadMind

Re: Getting output of /run - 16/01/03 03:23 PM

Running batch files and then read from files is not a very good solution, but using stdio.dll by DragonZap I think is better,
at least this is my opinion .)
I tried to run sime php scripts, it worked great.
But I think this should be made as a standart function in mIRC
Posted By: Bahamut

Re: Getting output of /run - 27/01/03 12:57 PM

Just an alternative to a batch file, you could use...

/run command /c ping www.mirc.com > ping.txt

And if you wanted to read the information as it was being put into the file, you could set up a simple script that checked a file for new text from the last time it was checked, using say a counter for how many lines there were in the output file the last time, compared to how many lines there are now, etc.
© 2020 mIRC Discussion Forums