Code:

def running(a)

running=`tasklist`

if running.include?(a)

puts “#{a} is already running in windows machine”

else

puts “#{a} is not running”

end

end

runnning(‘java.exe’)

#=>   java.exe is already running in windows machine

runnning(‘notepad.exe’)

#=> notepad.exe is not running

Where this code will useful:

We can able to chaeck the process is runnign or not — When Script need to close some opened Firefox windows or chrome windows

2 Responses to “Watir – handling hidden process in windows”

  1. Punit Says:

    This is really helpful for me….

  2. thulknugh Says:

    Lots of of folks talk about this topic but you said really true words.


Leave a Reply