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
Recent comments
1 year 23 weeks ago
1 year 23 weeks ago
1 year 25 weeks ago
1 year 27 weeks ago
1 year 42 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 45 weeks ago
1 year 46 weeks ago
1 year 48 weeks ago