{"id":6858,"date":"2019-04-30T06:09:15","date_gmt":"2019-04-30T13:09:15","guid":{"rendered":"https:\/\/www.coretechnologies.com\/blog\/?p=6858"},"modified":"2019-04-30T06:09:15","modified_gmt":"2019-04-30T13:09:15","slug":"legacy-application-network-drives","status":"publish","type":"post","link":"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/legacy-application-network-drives\/","title":{"rendered":"Q&#038;A: Can my Legacy Application Read Network Drives when Run as a Service?"},"content":{"rendered":"<div align=\"center\"><img decoding=\"async\" src=\"\/blog\/images\/qa-network-shares.png\" title=\"Q &#038; A - Accessing Network Shares from Windows Services\" alt=\"Q &#038; A - Accessing Network Shares from Windows Services\" border=\"0\" ><\/div>\n<div class=\"blog-qa-question-box\">\n<img decoding=\"async\" src=\"\/images\/quotes-transparent-21x21.png\">&nbsp;&nbsp;I am evaluating <a href=\"\/products\/AlwaysUp\/\">AlwaysUp<\/a>. I have a legacy application which must run as a local user. I can get it to run as a service using AlwaysUp.<\/p>\n<p>The application works with parameters. These point to a domain folder (eg. \\\\MyServer\\Data1\\). There is an obvious contradiction on one hand, running an application as a local machine user, and on the other hand, trying to access a domain folder. Wondering if there is any way AlwaysUp can accommodate this?<\/p>\n<p>I have mapped a drive from the local user to the network folder and cached credentials. This works. Only problem is cached credentials sometimes expire.<\/p>\n<p align=\"right\">&mdash; David<\/p>\n<\/div>\n<p>Hi David.<\/p>\n<p>Since your application must run as a local user, you should specify the account on AlwaysUp&#8217;s Logon tab:<\/p>\n<div align=\"center\"><a href=\"\/products\/AlwaysUp\/Screenshots\/alwaysup-add-application-logon-tab.png\" class=\"zoomPopup\" title=\"Enter your Windows account on the Logon tab\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"image-padding\" src=\"\/products\/AlwaysUp\/Screenshots\/alwaysup-add-application-logon-tab.png\" title=\"Enter your Windows account on the Logon tab (click to enlarge)\" alt=\"Enter your Windows account on the Logon tab\" border=\"0\" ><\/a><\/div>\n<p>Please enter the username and password for a user that has logged in and run your application successfully &mdash; likely the account you are logged into now.<\/p>\n<p>With that account in place, AlwaysUp will run your legacy application in the context of that user. Your program will be able to read from and write to any files that the account has permission to access.<\/p>\n<p>However, as you point out, using drive letters can be tricky. Beyond <a href=\"http:\/\/kb.mcgill.ca\/?portalid=2&#038;articleid=5420#tab:homeTab:crumb:8:artId:5420:src:article\" target=\"_blank\" rel=\"noopener noreferrer\">cached\/saved credentials<\/a>, drive mappings may not be automatically applied when you login as a service. For example, that &#8220;P&#8221; drive you see in Windows Explorer may not be available to your program running as a Windows Service.<\/p>\n<p>Fortunately, AlwaysUp can usually re-create your drive mappings. Check the <b>Attempt to automatically reconnect all network drives<\/b> option on the Extras tab to enable that feature:<\/p>\n<div align=\"center\"><a href=\"\/blog\/images\/automatically-reconnect-network-drives.png\" class=\"zoomPopup\" title=\"Automatically reconnect network drives\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"image-padding\" src=\"\/blog\/images\/automatically-reconnect-network-drives.png\" title=\"Automatically reconnect network drives (click to enlarge)\" alt=\"Automatically reconnect network drives\" border=\"0\" ><\/a><\/div>\n<p>But as the text implies, automatically reconnecting doesn&#8217;t work in all situations. Sometimes a password is required.<\/p>\n<p>To totally sidestep the issues of drive letters when running as a service, we recommend using <a href=\"https:\/\/en.wikipedia.org\/wiki\/Path_(computing)#Uniform_Naming_Convention\" target=\"_blank\" rel=\"noopener noreferrer\">UNC paths<\/a> instead of mapped drives whenever possible. Since your account has permissions to the underlying resource, that shouldn&#8217;t pose a problem.<\/p>\n<p>Will your application accept a UNC path? Please test to find out.<\/p>\n<h2 class=\"blog-caption\">Troubleshooting network\/mapped drives (and other issues)<\/h2>\n<p>By the way, <a href=\"\/blog\/alwaysup\/troubleshoot-alwaysup-command-prompt\/\">launching the command line interactively as a Windows Service<\/a> through AlwaysUp will give you the opportunity to experiment with your application as a service.<\/p>\n<p>For example, you can try to:<\/p>\n<ul>\n<li>\n<p>Change the directory (CD) to the UNC path and confirm that the files are accessible<\/p>\n<\/li>\n<li>\n<p>Run the full command to launch your legacy application with UNC path parameters. If it fails, you may have a permissions issue. Look to your application&#8217;s log files for clues.<\/p>\n<\/li>\n<\/ul>\n<p style=\"margin-top:30px\">\nBest of luck with your legacy program\/service! Please <a href=\"\/support\/\">get in touch<\/a> if you have any other questions.<\/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\/alwaysup\/run-service-after-start\/\"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 Launch a Service after AlwaysUp Starts my Application?\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/gears-working-together-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\">Q&amp;A: How do I Launch a Service after AlwaysUp Starts my Application?<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/v10-released\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"New Version\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/new-version-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\">AlwaysUp Version 10 Released: Keep Your Windows App Running 24\/7\/365<\/h2><\/div><\/div><\/a><a href=\"https:\/\/www.coretechnologies.com\/blog\/windows-services\/power\/\"class=\"relpost-block-single\" ><div class=\"relpost-custom-block-single\"><img decoding=\"async\" loading=\"lazy\" class=\"relpost-block-single-image\" alt=\"Essential Windows Services: Power\"  src=\"https:\/\/www.coretechnologies.com\/blog\/wp-content\/uploads\/power-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: Power<\/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>&nbsp;&nbsp;I am evaluating AlwaysUp. I have a legacy application which must run as a local user. I can get it to run as a service using AlwaysUp. The application works with parameters. These point to a domain folder (eg. \\\\MyServer\\Data1\\). &hellip; <a href=\"https:\/\/www.coretechnologies.com\/blog\/alwaysup\/legacy-application-network-drives\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":6866,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[26,102,127,196],"class_list":["post-6858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alwaysup","tag-alwaysup-tag","tag-mapped-drives","tag-qa","tag-windows-services-2"],"_links":{"self":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/6858","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=6858"}],"version-history":[{"count":0,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/posts\/6858\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media\/6866"}],"wp:attachment":[{"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/media?parent=6858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/categories?post=6858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.coretechnologies.com\/blog\/wp-json\/wp\/v2\/tags?post=6858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}