{"id":277,"date":"2008-05-12T11:54:43","date_gmt":"2008-05-12T06:24:43","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=277"},"modified":"2024-04-19T12:08:56","modified_gmt":"2024-04-19T06:38:56","slug":"mapped-drives-not-seen-elevated-command-prompt-task-scheduler","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/mapped-drives-not-seen-elevated-command-prompt-task-scheduler\/","title":{"rendered":"Mapped drives not seen from elevated Command Prompt and Task Scheduler"},"content":{"rendered":"<p>When you attempt to access a mapped network drive from an elevated or admin Command Prompt or Task Scheduler (with the highest privileges), the mapped drive won&#8217;t be available. Attempting to use the mapped network drives causes the error <b><i>The system cannot find the path specified (Error code: 0x80070003)<\/i><\/b>.<\/p>\n<p>Here are the screenshots from a computer running Windows 10.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10230\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/mapped-drives-enablelinkedconnections.png\" alt=\"mapped network drive not seen from admin command prompt and task scheduler\" width=\"697\" height=\"288\" \/><\/p>\n<p>However, the mapped network drive is accessible from File Explorer and regular (non-elevated) Command Prompt.<!--more--><\/p>\n<p>There is a registry-based solution that lets you use mapped drives from standard as well as elevated processes.<\/p>\n<p>(<a href=\"#fix\">Go to the solution directly<\/a>)<\/p>\n<div class=\"qt\">\nMicrosoft articles KB937624 <a title=\"Link to MS KB 937624\" href=\"https:\/\/web.archive.org\/web\/20100823111850\/http:\/\/support.microsoft.com\/kb\/937624\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">After you turn on UAC, programs may be unable to access some network locations<\/a>\u00a0and KB3035277 address this issue.<\/p>\n<h4>KB937624 states:<\/h4>\n<p><em>When an administrator logs on to Windows Vista, the Local Security Authority (LSA) creates two access tokens. If LSA is notified that the user is a member of the Administrators group, LSA creates the second logon that has the administrator rights removed (filtered). This filtered access token is used to start the user&#8217;s desktop. Applications can use the full administrator access token if the administrator user clicks Allow in a User Account Control dialog box.<\/em><\/p>\n<p><em>If a user is logged on to Windows Vista and if User Account Control is enabled, a program that uses the user&#8217;s filtered access token and a program that uses the user&#8217;s full administrator access token can run at the same time. Because LSA created the access tokens during two separate logon sessions, the access tokens contain separate logon IDs.<\/em><\/p>\n<p>As the drive mappings created from File Explorer are from a standard user token, the drives are not seen from an elevated token (e.g., Administrator Command Prompt or Scheduled Tasks configured to run with the highest privileges.)<\/p>\n<p>Another Microsoft article, KB3035277, titled <a href=\"https:\/\/learn.microsoft.com\/en-us\/troubleshoot\/windows-client\/networking\/mapped-drives-not-available-from-elevated-command\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">Mapped drives are not available from an elevated prompt when UAC is configured to &#8220;Prompt for credentials&#8221;<\/a>, explains along with a solution that works in Windows Vista through Windows 11.<\/p>\n<h4>KB3035277 states:<\/h4>\n<p><em>When UAC is enabled, the system creates two logon sessions at user logon. Both logon sessions are linked to one another. One session represents the user during an elevated session, and the other session where you run under least user rights.<\/em><\/p>\n<p><em>When drive mappings are created, the system creates symbolic link objects (&#8220;DosDevices&#8221;) that associate the drive letters to the UNC paths. These objects are specific for a logon session and are not shared between logon sessions.<\/em><\/p>\n<p><em>Note The EnableLinkedConnections registry entry forces the symbolic links to be written to both linked logon sessions that are created, when UAC is enabled.<\/em><\/p>\n<p>And here is a helpful note from James Finnigan [MSFT].<\/p>\n<blockquote><p>The &#8220;EnableLinkedConnections&#8221; policy relies on the user being a member of the Administrators group and sharing across the boundary between non-elevated and elevated (which can lead to intentionally misdirected drive mappings by Malware). It is essentially a workaround for customers that are in the process of moving their users to standard user, but need to do so gradually and keep them as members of the Administrators group in the short-term.<\/p><\/blockquote>\n<\/div>\n<h2><a id=\"fix\"><\/a>Resolution<\/h2>\n<p>As explained earlier, you can fix the problem by creating the <code><strong>EnableLinkedConnections<\/strong><\/code> DWORD (32-bit) value in the following registry key and setting its data to <strong><code>1<\/code><\/strong>.<\/p>\n<pre>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System<\/pre>\n<ol>\n<li>To create\/set the registry value, start the Registry Editor (<code>regedit.exe<\/code>)<\/li>\n<li>Go to the above branch.<\/li>\n<li>From the Edit menu, click New, DWORD (32-bit) Value.<\/li>\n<li>Name the DWORD value <code>EnableLinkedConnections<\/code> and set its data to <code>1<\/code>.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10231\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/mapped-drives-enablelinkedconnections-3.png\" alt=\"mapped network drive not seen from admin command prompt and task scheduler - enablelinkedconnections\" width=\"701\" height=\"122\" \/><\/li>\n<li>Exit the Registry Editor and <strong>restart Windows<\/strong>.<\/li>\n<\/ol>\n<p>The <code>EnableLinkedConnections<\/code> value enables Windows to share network connections between the filtered access token and the full administrator access token for a member of the Administrators group. It would be best if you restarted the computer after creating the registry value.<\/p>\n<p>After restarting Windows, the drives are accessible in regular and elevated processes\u2014i.e., processes running under the filtered access token and the full administrator access token.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10229\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2008\/05\/mapped-drives-enablelinkedconnections-2.png\" alt=\"mapped network drive not seen from admin command prompt and task scheduler\" width=\"695\" height=\"267\" \/><\/p>\n<h4>Using a .REG file<\/h4>\n<p>You can automate the above setting by <a href=\"https:\/\/www.winhelponline.com\/blog\/how-to-use-reg-files-registration-entries-windows\/\">creating a .reg file<\/a> from the following contents.<\/p>\n<pre>Windows Registry Editor Version 5.00\n\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System]\n\"EnableLinkedConnections\"=dword:00000001<\/pre>\n<hr>\n<h3>Task Scheduler still can&#8217;t access mapped drives?<\/h3>\n<p>If your Scheduled Tasks still fail to access the mapped network drives despite enabling the <code>EnableLinkedConnections<\/code> registry value, then you&#8217;ll need to check two things:<\/p>\n<ol>\n<li>A User Account control-related security policy. (and)<\/li>\n<li>If the scheduled task is configured to run under a different user, you&#8217;ll have to map the drive again from that user account. (see <strong>Important:<\/strong> note at the end of this article)<\/li>\n<\/ol>\n<p>If the following UAC Policy setting is configured to <strong>Prompt for credentials<\/strong>, the scheduled tasks (running with the highest privileges) fail to access the mapped network drive.<\/p>\n<pre>User Account Control: Behaviour of the elevation prompt for administrators in Admin Approval Mode<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9113\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/uac-asks-password-admin-1.png\" alt=\"UAC asks for password even if logged in as an administrator\" width=\"700\" height=\"262\" \/><\/p>\n<p>Using the Security Policy Editor (<code>secpol.msc<\/code>) or the Registry Editor, you&#8217;ll need to set the above policy to <strong>Prompt for Content<\/strong>\u00a0 or <strong>Prompt for Content for non-Windows binaries <\/strong>(which is the Windows default setting.)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9114\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/uac-asks-password-admin-2.png\" alt=\"UAC asks for password even if logged in as an administrator\" width=\"417\" height=\"267\" \/><\/p>\n<p><em>More instructions to configure the above security policy (along with an alternative registry-based solution) are available in the article <a href=\"https:\/\/www.winhelponline.com\/blog\/uac-asks-password-even-logged-administrator\/\">UAC asks for a password even if logged in as administrator.<\/a><\/em><\/p>\n<p>After resetting the above policy, restart Windows. Your mapped drives should be available for scheduled tasks configured to run with the highest privileges.<\/p>\n<p><strong>Important:<\/strong> However, when you&#8217;re running the task under a <strong>different<\/strong> user account or the <code>SYSTEM<\/code> (<a href=\"https:\/\/www.winhelponline.com\/blog\/run-program-as-system-localsystem-account-windows\/\">LocalSystem<\/a>) context, the mapped drives won&#8217;t be seen despite the <code>EnableLinkedConnections<\/code> registry value. This is because the network drive mappings are per-user. That means you&#8217;ll need to map the drive again under that specific user account configured to run the scheduled task.<\/p>\n<p><em>Information in this article applies to Windows Vista through Windows 11.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you attempt to access a mapped network drive from an elevated or admin Command Prompt or Task Scheduler (with the highest privileges), the mapped drive won&#8217;t be available. Attempting to use the mapped network drives causes the error The system cannot find the path specified (Error code: 0x80070003). Here are the screenshots from a &#8230; <a title=\"Mapped drives not seen from elevated Command Prompt and Task Scheduler\" class=\"read-more\" href=\"https:\/\/www.winhelponline.com\/blog\/mapped-drives-not-seen-elevated-command-prompt-task-scheduler\/\" aria-label=\"Read more about Mapped drives not seen from elevated Command Prompt and Task Scheduler\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7],"tags":[441],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-windows","tag-registry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":17902,"url":"https:\/\/www.winhelponline.com\/blog\/mapped-network-drives-fix-windows-10-v2004\/","url_meta":{"origin":277,"position":0},"title":"[Fix] Mapped Network Drives don&#8217;t work in Windows 10 v2004","author":"Ramesh","date":"August 15, 2020","format":false,"excerpt":"After updating to Windows 10 version 2004, mapped network drives don't reconnect after a restart. Here are some of the symptoms you may be experiencing: Mapped drives that link to your NAS (e.g., Synology, ReadyNAS, etc.) or Windows 2000\/XP\/2003 computers do not work after upgrading to Windows 10 v2004. Remapping\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"windows 10 2004 mapped network drives not working","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/mapped-drive-credentials-manager-add.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/mapped-drive-credentials-manager-add.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/mapped-drive-credentials-manager-add.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":10054,"url":"https:\/\/www.winhelponline.com\/blog\/find-the-ip-address-of-a-mapped-network-drive-in-windows\/","url_meta":{"origin":277,"position":1},"title":"Find the IP address of a Mapped Network drive in Windows","author":"Ramesh","date":"June 29, 2019","format":false,"excerpt":"Network shares are accessed using their UNC paths (begin with \\\\). For frequently accessed network shares, the UNC path can be mapped to a drive letter in Windows. You may be wondering how to find out the IP address of a mapped network drive -- i.e., the IP of the\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"find ip address of mapped network drive","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/mapped-drive-find-ip-address-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/mapped-drive-find-ip-address-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/mapped-drive-find-ip-address-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/06\/mapped-drive-find-ip-address-1.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":335,"url":"https:\/\/www.winhelponline.com\/blog\/run-programs-elevated-without-getting-the-uac-prompt\/","url_meta":{"origin":277,"position":2},"title":"How to Run Programs as Administrator (Elevated) without UAC Prompt","author":"Ramesh","date":"June 17, 2008","format":false,"excerpt":"Recently, I came across a brilliant tip on how to run programs elevated without getting the User Account Control (UAC) prompt. This can be done without turning off the UAC and hence it does not compromise system security. How to Run Programs elevated without UAC Prompt You can run apps\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/archived2\/myapps-sched.gif?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1520,"url":"https:\/\/www.winhelponline.com\/blog\/open-elevated-command-prompt-windows\/","url_meta":{"origin":277,"position":3},"title":"How to Open Elevated or Admin Command Prompt in Windows?","author":"Ramesh","date":"March 5, 2007","format":false,"excerpt":"Command Prompt is one of the most used tools in Windows. For tasks requiring administrator privileges, we need to start Command Prompt as administrator (\"elevated\"). This article describes different ways to open an elevated or administrator Command Prompt window. How to Open Elevated or Admin Command Prompt From the Win-X\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"task manager -run command prompt elevated - create new task","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2007\/03\/taskmgr-cmd-elevated.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1632,"url":"https:\/\/www.winhelponline.com\/blog\/run-as-administrator-does-not-work-windows\/","url_meta":{"origin":277,"position":4},"title":"Run as Administrator Option Missing or Does Nothing; File Association Error","author":"Ramesh","date":"February 14, 2016","format":false,"excerpt":"Symptoms Case 1:\u00a0When you right-click on an executable file or a shortcut, the Run as Administrator may be missing. From Windows 10 or 11 Start menu, if you right-click a program, click More, and select Run as administrator, nothing may happen. Right-clicking Start and clicking Command Prompt (Admin) or PowerShell\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"runasadmin legacydisable error","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/runasadmin-legacydisable-error-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/runasadmin-legacydisable-error-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/02\/runasadmin-legacydisable-error-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":80392,"url":"https:\/\/www.winhelponline.com\/blog\/task-scheduler-service-started-stopped\/","url_meta":{"origin":277,"position":5},"title":"Task Scheduler Service on Local Computer Started and then Stopped","author":"Ramesh","date":"March 3, 2026","format":false,"excerpt":"The Task Scheduler service may fail to start, and the following error may occur when you try to start it manually using the Services MMC in Windows 10 or 11. The Task Scheduler service on Local Computer started and then stopped. Some services stop automatically if they are not in\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"task scheduler empty","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2026\/03\/task_scheduler_launch_empty.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2026\/03\/task_scheduler_launch_empty.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2026\/03\/task_scheduler_launch_empty.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2026\/03\/task_scheduler_launch_empty.png?resize=700%2C400&ssl=1 2x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=277"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}