{"id":3103,"date":"2019-03-25T17:42:43","date_gmt":"2019-03-25T20:42:43","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb56005-checking-whether-the-program-is-being-executed\/"},"modified":"2020-01-23T10:12:04","modified_gmt":"2020-01-23T13:12:04","slug":"kb56005-checking-whether-the-program-is-being-executed","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/","title":{"rendered":"KB-56005: Checking whether the program is being executed."},"content":{"rendered":"<div align=\"justify\">\n<p><b>Question:<\/b><\/p>\n<p>Can I check, via scripts, if a program is being executed?<\/p>\n<p><b>Solution:<\/b><\/p>\n<p>Yes. By using <b>winmgmts <\/b>object and accessing the <b>Win32_process<\/b> instances, you can scan the name of all Windows processes. Then, all you will need is to test for the name of the desired process to know whether it is being executed.<\/p>\n<p>For example:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">set objService = getobject(&#8220;winmgmts:&#8221;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">for each Process in objService.InstancesOf(&#8220;Win32_process&#8221;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 if Process.Name\u00a0 = &#8220;calc.exe&#8221; then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a = 1\u00a0\u00a0 <\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 end if<\/span><br \/>\n<span style=\"font-family: Courier New;\">Next<\/span><span style=\"font-family: Courier New;\">if a = 1 then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MsgBox &#8220;Calculator is being executed!&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">else<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.ExecuteExternalApp &#8220;calc.exe&#8221;, &#8220;&#8221;, &#8220;&#8221;, 1\u00a0 <\/span><br \/>\n<span style=\"font-family: Courier New;\">end if<\/span><\/p>\n<\/div>\n<p><b>NOTE<\/b>: The sample application attached to this article was developed with E3 version 4.0 b225.<\/p>\n<\/div>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/Sample-5.zip\">Sample<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: Can I check, via scripts, if a program is being executed? Solution: Yes. By using winmgmts object and accessing the Win32_process instances, you can scan the name of all&hellip;<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-56005: Checking whether the program is being executed. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-56005: Checking whether the program is being executed.\" \/>\n<meta property=\"og:description\" content=\"Question: Can I check, via scripts, if a program is being executed? Solution: Yes. By using winmgmts object and accessing the Win32_process instances, you can scan the name of all&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:42:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-23T13:12:04+00:00\" \/>\n<meta name=\"author\" content=\"C\u00e9zar Lumiatti Teixeira\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"C\u00e9zar Lumiatti Teixeira\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\"},\"author\":{\"name\":\"C\u00e9zar Lumiatti Teixeira\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b\"},\"headline\":\"KB-56005: Checking whether the program is being executed.\",\"datePublished\":\"2019-03-25T20:42:43+00:00\",\"dateModified\":\"2020-01-23T13:12:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\"},\"wordCount\":119,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\",\"name\":\"[:pt]KB-56005: Checking whether the program is being executed.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:42:43+00:00\",\"dateModified\":\"2020-01-23T13:12:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-56005: Checking whether the program is being executed.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b\",\"name\":\"C\u00e9zar Lumiatti Teixeira\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g\",\"caption\":\"C\u00e9zar Lumiatti Teixeira\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/teixeira\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-56005: Checking whether the program is being executed. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-56005: Checking whether the program is being executed.[:] - Elipse Knowledgebase","og_description":"Question: Can I check, via scripts, if a program is being executed? Solution: Yes. By using winmgmts object and accessing the Win32_process instances, you can scan the name of all&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:42:43+00:00","article_modified_time":"2020-01-23T13:12:04+00:00","author":"C\u00e9zar Lumiatti Teixeira","twitter_card":"summary_large_image","twitter_misc":{"Written by":"C\u00e9zar Lumiatti Teixeira","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/"},"author":{"name":"C\u00e9zar Lumiatti Teixeira","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b"},"headline":"KB-56005: Checking whether the program is being executed.","datePublished":"2019-03-25T20:42:43+00:00","dateModified":"2020-01-23T13:12:04+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/"},"wordCount":119,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/","url":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/","name":"[:pt]KB-56005: Checking whether the program is being executed.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:42:43+00:00","dateModified":"2020-01-23T13:12:04+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb56005-checking-whether-the-program-is-being-executed\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-56005: Checking whether the program is being executed."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/843cbcdf9865f72399446377cf0cfc2b","name":"C\u00e9zar Lumiatti Teixeira","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8ab17a30c6ba62b79eaefe2a0a0b8b1b?s=96&d=mm&r=g","caption":"C\u00e9zar Lumiatti Teixeira"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/teixeira\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3103"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=3103"}],"version-history":[{"count":3,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3103\/revisions"}],"predecessor-version":[{"id":9960,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/3103\/revisions\/9960"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=3103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=3103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=3103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}