{"id":589,"date":"2014-05-09T12:15:39","date_gmt":"2014-05-09T19:15:39","guid":{"rendered":"http:\/\/www.coretechnologies.com\/blog\/?p=589"},"modified":"2014-05-09T12:15:39","modified_gmt":"2014-05-09T19:15:39","slug":"start-windows-service-usb-flash-drive","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/service-trigger-editor\/start-windows-service-usb-flash-drive\/","title":{"rendered":"How to Start your Windows Service When a USB Flash Drive is Inserted"},"content":{"rendered":"<p>Windows Services are designed to start up at boot and run 24&#215;7, but that framework is overkill for server software that must occasionally come alive to process specific events and go back to a waiting state. Service Triggers were introduced in Windows 7 to remedy the situation but at this point, only a handful of triggering events are supported. We look forward to more capabilities (and better documentation!) of this useful feature in future versions of Windows.<\/p>\n<p>If you have a Windows Service that works with USB flash drives, you can use our free <a href=\"\/products\/ServiceTriggerEditor\/\" target=\"_blank\" rel=\"noopener noreferrer\">Service Trigger Editor utility<\/a> to configure your service to start when a flash drive is inserted. To do so:<\/p>\n<ol>\n<li>\n<p>\n<a href=\"\/products\/ServiceTriggerEditor\/ServiceTriggerEditor.exe\">Download Service Trigger Editor<\/a> from our web site. Note that it is a standalone executable, <b>ServiceTriggerEditor.exe<\/b>, so just save it in a new folder on your hard drive.\n<\/p>\n<\/li>\n<li>\n<p>\nRun ServiceTriggerEditor.exe. You should see the standard security prompt if <a href=\"http:\/\/en.wikipedia.org\/wiki\/User_Account_Control\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">User Account Control (UAC)<\/a> is enabled on your PC:\n<\/p>\n<p>\n<a href=\"\/blog\/images\/service-trigger-editor-uac-prompt.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Service Trigger Editor: UAC Prompt\" target=\"_blank\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/service-trigger-editor-uac-prompt.png\" width=\"484\" height=\"282\" border=\"0\" title=\"Service Trigger Editor: UAC Prompt (click to enlarge)\" alt=\"Service Trigger Editor: UAC Prompt\" \/><br \/>\n<\/a>\n<\/p>\n<p>Service Trigger Editor is digitally signed by our company for your safety &amp; security so please click <b>Yes<\/b> to proceed.\n<\/li>\n<li>\n<p>\nOnce the utility&#8217;s main window comes up, listing all services installed on your PC, find and highlight the service you wish to modify. We have selected the SyncToy service (created by our <a href=\"\/products\/AlwaysUp\/\" target=\"_blank\" rel=\"noopener noreferrer\">AlwaysUp<\/a> product) for this tutorial.\n<\/p>\n<p>\n<a href=\"\/blog\/images\/service-trigger-editor-service-selected.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Service Trigger Editor: Main Window\" target=\"_blank\"><br \/>\n<img decoding=\"async\" src=\"\/blog\/images\/service-trigger-editor-service-selected.png\" border=\"0\" title=\"Service Trigger Editor: Main Window (click to enlarge)\" alt=\"Service Trigger Editor: Main Window\" width=\"550\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<li>\n<p>\nSelect <b>Trigger > Add&#8230;<\/b> to summon the <b>Add Trigger<\/b> window. Adjust the settings to start the service when <b>A specific device arrives (or is present at startup)<\/b>.\n<\/p>\n<p>\n<a href=\"\/blog\/images\/add-device-arrival-trigger.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Add a Device Arrival Trigger\" target=\"_blank\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/add-device-arrival-trigger.png\" width=\"499\" height=\"404\" border=\"0\" title=\"Add a Device Arrival Trigger (click to enlarge)\" alt=\"Add a Device Arrival Trigger\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<li>\n<p>\nNext, click the <b>Add&#8230;<\/b> button on the right, enter <b>USBSTOR\\GenDisk<\/b> in the window that comes up, and click OK to record that value.\n<\/p>\n<p>\n<a href=\"\/blog\/images\/add-trigger-data.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Add Trigger Data\" target=\"_blank\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/add-trigger-data.png\" width=\"349\" height=\"210\" border=\"0\" title=\"Add Trigger Data (click to enlarge)\" alt=\"Add Trigger Data\" \/><br \/>\n<\/a>\n<\/p>\n<p>\nWe&#8217;re now done configuring this new trigger so click the <b>Save >><\/b> button.\n<\/p>\n<p>\n<a href=\"\/blog\/images\/add-device-arrival-trigger2.png\" class=\"zoomPopup\" rel=\"zoomgroup noopener noreferrer\" title=\"Add a Device Arrival Trigger\" target=\"_blank\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/images\/add-device-arrival-trigger2.png\" width=\"499\" height=\"404\" border=\"0\" title=\"Add a Device Arrival Trigger (click to enlarge)\" alt=\"Add a Device Arrival Trigger\" \/><br \/>\n<\/a>\n<\/p>\n<\/li>\n<\/ol>\n<p>\nThat&#8217;s it. Next time you insert a USB flash drive, your service will start. Enjoy!<\/p>\n<!-- relpost-thumb-wrapper --><div class=\"relpost-thumb-wrapper\"><!-- filter-class --><div class=\"relpost-thumb-container\"><style>.relpost-block-single-image, .relpost-post-image { margin-bottom: 10px; }<\/style><h3>You may also like...<\/h3><div style=\"clear: both\"><\/div><div style=\"clear: both\"><\/div><!-- relpost-block-container --><div class=\"relpost-block-container relpost-block-column-layout\" style=\"--relposth-columns: 3;--relposth-columns_t: 2; --relposth-columns_m: 2\"><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/restart-remote-service\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Q&amp;A: How do I Restart a Windows Service on a Remote Computer?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/restart-remote-service-150x150-1.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Q&amp;A: How do I Restart a Windows Service on a Remote Computer?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/dcomlaunch\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Essential Windows Services: DcomLaunch \/ DCOM Server Process Launcher\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/dcom-communication-150x150.png\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">Essential Windows Services: DcomLaunch \/ DCOM Server Process Launcher<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/gui-applications-as-windows-services\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"How to Run Your GUI Applications as Windows Services (Without Breaking Them)\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/run-gui-applications-windows-services-150x150-1.webp\" style=\"aspect-ratio:1\/1\" style=\"aspect-ratio:1\/1\"><\/img><div class=\"relpost-block-single-text\"  style=\"height: 75px;font-family: Arial;  font-size: 12px;  color: #333333;\"><h2 class=\"relpost_card_title\">How to Run Your GUI Applications as Windows Services (Without Breaking Them)<\/h2><\/div><\/div><\/a><\/div><!-- close relpost-block-container --><div style=\"clear: both\"><\/div><\/div><!-- close filter class --><\/div><!-- close relpost-thumb-wrapper -->","protected":false},"excerpt":{"rendered":"<p>Windows Services are designed to start up at boot and run 24&#215;7, but that framework is overkill for server software that must occasionally come alive to process specific events and go back to a waiting state. Service Triggers were introduced &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/service-trigger-editor\/start-windows-service-usb-flash-drive\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[150,169,196],"class_list":["post-589","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-service-trigger-editor","tag-service-trigger-editor-2","tag-trigger-start-services","tag-windows-services-2"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/comments?post=589"}],"version-history":[{"count":0,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/589\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/2251"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}