{"id":2956,"date":"2019-03-25T17:42:00","date_gmt":"2019-03-25T20:42:00","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb34941-executing-an-external-program-when-the-domain-starts\/"},"modified":"2020-01-23T10:53:24","modified_gmt":"2020-01-23T13:53:24","slug":"kb34941-executing-an-external-program-when-the-domain-starts","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/","title":{"rendered":"KB-34941: Executing an external program when the domain starts."},"content":{"rendered":"<div style=\"text-align: justify;\">\n<p><span style=\"font-weight: bold;\">Question:<\/span><\/p>\n<p>How can I execute an application when the domain starts, even if there is no open <span style=\"font-weight: bold;\">E3Viewer<\/span>?<\/p>\n<p><span style=\"font-weight: bold;\">Solution<\/span>:<\/p>\n<p>To do so, just place the following script at an Internal Tag&#8217;s <span style=\"font-style: italic;\">OnStartRunning <\/span>event:<\/p>\n<div style=\"text-align: left;\"><span style=\"font-family: Courier New; color: #000000;\">Set WshShell = CreateObject(&#8220;WScript.Shell&#8221;)<\/span><br style=\"font-family: Courier New; color: #000000;\" \/><span style=\"font-family: Courier New; color: #000000;\">WshShell.Run &#8220;c:\\AppE3\\application.exe&#8221;<\/span><\/div>\n<p>That way, it will be executed whenever the domain starts.<\/p>\n<p>However, to finish this process when the domain stops, you will need to know the <span style=\"font-weight: bold;\">PID <\/span>(ProcessID) created for it after <span style=\"font-family: Courier New; color: #000000;\">WshShell.Run<\/span> has been executed. After this information has been retrieved, you must edit the script above as follows:<\/p>\n<div style=\"text-align: left; font-family: Courier New; color: #000000;\">WshShell.Run &#8220;c:\\AppE3\\application.exe&#8221;<br \/>\nProcessName = &#8220;application.exe&#8221;<br \/>\nSet service = GetObject(&#8220;winmgmts:\\\\.\\root\\cimv2&#8243;)<br \/>\nSet results = service.ExecQuery(&#8221; Select * from Win32_Process where Name = &#8221; &#038; ProcessName)<br \/>\nif results.count <> 0 then<br \/>\nfor each obj in results<br \/>\nTagInternoProcessID = obj.ProcessId<br \/>\nexit sub<br \/>\nnext<br \/>\nend if<\/div>\n<p>Then, to finish the <span style=\"font-weight: bold;\">PID<\/span>, you must create the following script at an Internal Tag&#8217;s <span style=\"font-style: italic;\">OnStopRunning <\/span>event:<\/p>\n<div style=\"text-align: left; font-family: Courier New; color: #000000;\">Set service = GetObject(&#8220;winmgmts:\\\\.\\root\\cimv2&#8243;)<br \/>\nSet results = service.ExecQuery(&#8221; Select * from Win32_Process where ProcessId ='&#8221; &#038; TagInternoProcessID &#038; &#8220;&#8216;&#8221;)<br \/>\nfor each obj in results<br \/>\nobj.Terminate()<br \/>\nexit sub<br \/>\nnext<\/div>\n<p><span style=\"font-weight: bold;\">NOTE<\/span>: please review your script, setting up the necessary variables and links for the Internal Tag.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Question: How can I execute an application when the domain starts, even if there is no open E3Viewer? Solution: To do so, just place the following script at an Internal&hellip;<\/p>\n","protected":false},"author":8,"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-34941: Executing an external program when the domain starts. - 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\/kb34941-executing-an-external-program-when-the-domain-starts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-34941: Executing an external program when the domain starts.\" \/>\n<meta property=\"og:description\" content=\"Question: How can I execute an application when the domain starts, even if there is no open E3Viewer? Solution: To do so, just place the following script at an Internal&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/\" \/>\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:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-23T13:53:24+00:00\" \/>\n<meta name=\"author\" content=\"Renan De Rossi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Renan De Rossi\" \/>\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\/kb34941-executing-an-external-program-when-the-domain-starts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/\"},\"author\":{\"name\":\"Renan De Rossi\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/05f0d8f49e5ffe573156b4bd742c627f\"},\"headline\":\"KB-34941: Executing an external program when the domain starts.\",\"datePublished\":\"2019-03-25T20:42:00+00:00\",\"dateModified\":\"2020-01-23T13:53:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/\"},\"wordCount\":216,\"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\/kb34941-executing-an-external-program-when-the-domain-starts\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/\",\"name\":\"[:pt]KB-34941: Executing an external program when the domain starts.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:42:00+00:00\",\"dateModified\":\"2020-01-23T13:53:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-34941: Executing an external program when the domain starts.\"}]},{\"@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\/05f0d8f49e5ffe573156b4bd742c627f\",\"name\":\"Renan De Rossi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/39b08f7b309bb6a0abb90e1f09048d80?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/39b08f7b309bb6a0abb90e1f09048d80?s=96&d=mm&r=g\",\"caption\":\"Renan De Rossi\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/renan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-34941: Executing an external program when the domain starts. - 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\/kb34941-executing-an-external-program-when-the-domain-starts\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-34941: Executing an external program when the domain starts.[:] - Elipse Knowledgebase","og_description":"Question: How can I execute an application when the domain starts, even if there is no open E3Viewer? Solution: To do so, just place the following script at an Internal&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:42:00+00:00","article_modified_time":"2020-01-23T13:53:24+00:00","author":"Renan De Rossi","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Renan De Rossi","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/"},"author":{"name":"Renan De Rossi","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/05f0d8f49e5ffe573156b4bd742c627f"},"headline":"KB-34941: Executing an external program when the domain starts.","datePublished":"2019-03-25T20:42:00+00:00","dateModified":"2020-01-23T13:53:24+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/"},"wordCount":216,"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\/kb34941-executing-an-external-program-when-the-domain-starts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/","url":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/","name":"[:pt]KB-34941: Executing an external program when the domain starts.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:42:00+00:00","dateModified":"2020-01-23T13:53:24+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb34941-executing-an-external-program-when-the-domain-starts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-34941: Executing an external program when the domain starts."}]},{"@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\/05f0d8f49e5ffe573156b4bd742c627f","name":"Renan De Rossi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/39b08f7b309bb6a0abb90e1f09048d80?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/39b08f7b309bb6a0abb90e1f09048d80?s=96&d=mm&r=g","caption":"Renan De Rossi"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/renan\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2956"}],"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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=2956"}],"version-history":[{"count":1,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2956\/revisions"}],"predecessor-version":[{"id":10005,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2956\/revisions\/10005"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=2956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=2956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=2956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}