mIRC Home    About    Download    Register    News    Help

Print Thread
#188895 01/11/07 01:59 PM
Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
Hello there,

I'm trying to make a script that execute a dos command and give
the results back.

But now I found the option $com but how to use it for doing dos commands? And is it possible to use it.

(I used dll's but after a while it just let irc crash :()

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You can use WScript.Shell's Exec() method, it won't allow you to hide the command window, though. Run() does, but you can't catch the output with that.

See here for an example script.

Joined: Sep 2003
Posts: 84
T
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
Thnx, it does just what I needed.

Joined: Mar 2006
Posts: 395
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 395
Oh, just had a look... nice work

To make it close...

change this line:
Code:
   if ( !$com(stdcatch.shell $+ %i,Exec,1,bstr,$1-,dispatch* stdcatch.exec $+ %i) ) || ( !$com(stdcatch.exec $+ %i) ) { 


to this:
Code:
   if ( !$com(stdcatch.shell $+ %i,Exec,1,bstr,cmd.exe /C $+ $1-,dispatch* stdcatch.exec $+ %i) ) || ( !$com(stdcatch.exec $+ %i) ) { 


Obviously CMD.EXE only works on Windows NT... but you would change it to command.com if you were on Windows 9X.

Hope it helps


[02:16] * Titanic has quit IRC (Excess Flood)

Link Copied to Clipboard