Check two instances of exe file

  • Is there a way to check two instances of exe files. I have one exe files but running under two instances. when I check in the task manager I see two same exe files.

    I would like to write a script which will check if there are two instances of same exe files running and send an alert .

    Any help will be appreciated.

  • I just found a trick to check two instances of same exe file in task manager. I would like to share with you guys.

    There is a dos commant called tasklist which captures all the services so the trick is :

    create table #tasklist(servicename varchra(100)

    insert into #tasklist

    exec master.dbo.xp_cmdshell 'tasklist'

    select * from #tasklist

    once to get all the services in the temp table then you can check if there are two duplicate services are running then send an alert.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply