mIRC Home    About    Download    Register    News    Help

Print Thread
#5913 10/01/03 09:36 AM
Joined: Dec 2002
Posts: 94
K
krunch Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Dec 2002
Posts: 94
to run this dos prompt i have to make a batch file (not a big deal) but I want to make things faster and smaller

run C:\PROGRA~1\******\******.exe -lcmfd %loc.file > %loc.filename

%loc.file = string
%loc.filename = output

but that does not work, i've tryed
run " $+ C:\PROGRA~1\******\******.exe $+ " -lcmfd %loc.file > %loc.filename
etc and it runs the prompt but does not output the results, or is there a way to get mirc to read the results without putting to a output?
anyhelp is great


Lets get dirty
#5914 10/01/03 01:20 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Quote:
run C:\PROGRA~1\******\******.exe -lcmfd %loc.file > %loc.filename


Where did you get the -lcmfd from? I take those parameters are assocoated with the program being run and are not anything to do with mIRC...?

Simply, I just wrote:
Code:
/runfile {
  run command.com /c dir c:\ > c:\test.txt
}

and that replaced all in c:\text.txt with the results of the dir command.

I don't know if there's a way you can use mIRC to see if the command executed using run has completed, if there is such a thing, then you could easilly get mIRC to read out the lines in the text file using:

Code:
/playfile {
  var %i = 1
  window -a @Test
  clear @Test
  while (%i <= $lines(c:\test.txt)) {
    if ($read(c:\test.txt, %i) !== $null) { aline @Test $read(c:\test.txt, %i) }
    inc %i
  }
}


Hope that's what you were trying to do...


Aubs.
cool

#5915 11/01/03 01:33 AM
Joined: Dec 2002
Posts: 94
K
krunch Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Dec 2002
Posts: 94
reading from the file is not the prob smile
its running the command,
atm i've got it to make a bat file that runs it,
but thats 3lines to text to make a batch file and then delete it
i'm just wanting to make it smaller and run a little faster,
i've tryed
run c:\path\to\command.exe -lcfm > c:\path\to\output.txt
it exe's the file but does not put to an output file


Lets get dirty
#5916 13/01/03 11:40 AM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
Sorry, but I don't understand what it is you are after...

from your last post, I presume:

1) You have mIRC (using 3 lines of code) to create a bat file
2) You have mIRC run the bat file then delete it
3) it runs the command but doesn't output...and then you've tried it with /run...

Quote:
i've tryed
run c:\path\to\command.exe -lcfm > c:\path\to\output.txt


Ok, so now we may be getting somewhere...

Code:
U:\>command /?
Starts a new instance of the MS-DOS command interpreter.
 
COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]
 
  [drive:]path    Specifies the directory containing COMMAND.COM file.
  device          Specifies the device to use for command input and output.
  /E:nnnnn        Sets the initial environment size to nnnnn bytes.
  /P              Makes the new command interpreter permanent (can't exit).
  /C string       Carries out the command specified by string, and then stops.
  /MSG            Specifies that all error messages be stored in memory. You
                  need to specify /P with this switch.

you use: command.exe -lcfm

Where in the code (help text) above do the switches -lcfm come from? - They are not switches for the /run command in mIRC:
Code:
/run [-np] <filename> [parameters]
Runs the specified program with parameters.
 
The -n switch minimizes the window of the application being run.
The -p switch sets the working path to the path of the application being run.
 
You can enclose the filename or parameters in quotes if you need to. If you specify
a non-executable file, mIRC tries to open it with the application associated with that file
and again it's not a valid switch for command.com.

It seems to me, that unless you've got a special command.com or are using a different executable file other than command.com, that the switches will not work (also note that with DOS, you would normally use switches for e.g. /Switch and in mIRC -Switch

Don't know if this has anything to do with it...Seems like there's nothing to output...

Hope this isn't going on too much, am working and have to keep coming back to this to finish!! (and its a Monday Morning!!!)


[EDIT: added a newline to get the forum back into alignment -Hammer]

Last edited by Hammer; 13/01/03 12:19 PM.

Aubs.
cool


Link Copied to Clipboard