mIRC Home    About    Download    Register    News    Help

Print Thread
#188895 01/11/07 01:59 PM
T
Turbo_boy
Turbo_boy
T
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 :()

#188896 01/11/07 02:15 PM
Joined: Dec 2002
Posts: 3,015
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,015
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.

T
Turbo_boy
Turbo_boy
T
Thnx, it does just what I needed.

#189107 04/11/07 01:45 AM
Joined: Mar 2006
Posts: 392
T
Pan-dimensional mouse
Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 392
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