Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
eliteop
Voice
Posts: 2 Joined: Sun Feb 12, 2006 3:20 pm
Post
by eliteop » Sun Feb 12, 2006 3:23 pm
Hi, can somebody help me?
I need a tcl that search every x minutes if a process is running and, if it is, tell it on a irc channel.
Something like: if i open notepad.exe i would like windrop to tell on irc "notepad.exe was just opened bla bla bla"
Thanks for your time
deadite66
Halfop
Posts: 74 Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK
Post
by deadite66 » Thu Feb 16, 2006 1:04 pm
it could be done with a small vbscript as your using windrop.
Code: Select all
set wmi = getobject("winmgmts:")
wql = "select * from win32_process " _
& " where name='notepad.exe'"
set results = wmi.execquery(wql)
WScript.Echo results.count
if you had a tcl script to run
c:/windows/system32/cscript //Nologo c:/myscript.vbs
and catch the result.
0 = no notepad open
1+ = how many open
<- tcl newb
eliteop
Voice
Posts: 2 Joined: Sun Feb 12, 2006 3:20 pm
Post
by eliteop » Wed Feb 22, 2006 7:33 am
and how to link it with the tcl for irc announcement?
Thanks
deadite66
Halfop
Posts: 74 Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK
Post
by deadite66 » Wed Feb 22, 2006 4:08 pm
try this, youl need to change the path to where the vbs script is and change the 2 #mychannel bits to your channel.
Code: Select all
set apprunningcheck 0
bind time - * go:appcheck
proc go:appcheck {m h d mo y} {
global apprunningcheck
set appres [exec c:/windows/system32/cscript //Nologo c:/test.vbs]
if {$appres != $apprunningcheck & $appres == "0"} {
puthelp "PRIVMSG #mychannel :app exited" ; set apprunningcheck 0
}
if {$appres != $apprunningcheck & $appres == "1"} {
puthelp "PRIVMSG #mychannel :app started" ; set apprunningcheck 1
}
}
<- tcl newb