Shoutbox

once "NxWin.exe" closes, taskkill NxSSH.exe [solved: <3 segosa] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: once "NxWin.exe" closes, taskkill NxSSH.exe [solved: <3 segosa] (/showthread.php?tid=85997)

once "NxWin.exe" closes, taskkill NxSSH.exe [solved: <3 segosa] by prashker on 09-17-2008 at 09:37 PM

i dunno, segosa told me something about tasklist :p

(apparently this cannot be done in batch so can someone compile an exe for me or something :p)


RE: once "NxWin.exe" closes, taskkill NxSSH.exe (can someone write this for me?) by Ezra on 09-17-2008 at 10:44 PM

A Batch COULD do it if you used it to start NxWin.


RE: once "NxWin.exe" closes, taskkill NxSSH.exe (can someone write this for me?) by segosa on 09-17-2008 at 10:47 PM

tasklist lists all processes.

tasklist | find "NxWin.exe" will list NxWin.exe (if it exists)

I can't be bothered to figure out the batch file syntax, but you basically need to stick the result of tasklist | find "NxWin.exe" into a variable (or check directly) and see if it's empty. If it's empty, then NxWin.exe is gone, so you wanna taskkill NxSSH.exe.

Edit: Better yet, use tasklist | find /C "mirc.exe" and the result will be 1 if it exists and 0 otherwise, so that could be checked a lot easier.

Edit: oh screw you

download http://gifpaste.org/tmp/sleep.exe and stick it in your windows directory

code:
@echo off
rem fuck you batch script.
set proc=NxWin.exe

:crap

tasklist | find /C "%proc%" > nul

if "%ERRORLEVEL%" == "1" (
    echo I can't find %proc%
    taskkill /F /IM NxSSH.exe
    goto sonicsamfails
)

echo I've found nothing!
sleep 1

goto crap

:sonicsamfails
echo I killed it