{"id":5620,"date":"2020-09-21T17:00:00","date_gmt":"2020-09-21T15:00:00","guid":{"rendered":"https:\/\/www.razumny.no\/?p=5620"},"modified":"2020-09-09T09:09:43","modified_gmt":"2020-09-09T07:09:43","slug":"mapping-a-local-folder-to-a-windows-drive-letter","status":"publish","type":"post","link":"https:\/\/www.razumny.no\/?p=5620","title":{"rendered":"Mapping a local folder to a Windows drive letter"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A little while ago, I needed to simulate the File Explorer presentation of a network share in order to illustrate a point to a very non-technical customer of mine. Luckily, this is very easily accomplished through the use of either the <code>subst<\/code> or <code>net use<\/code> command line commands. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The difference between the two commands is that <code>subst<\/code> expects the location to always be available. If the location can not be found, <code>subst<\/code> will try its damnedest to reconnect to the location &#8211; at the cost of performance. On the other hand, <code>net use<\/code> will simply disable the mapping until you try to access it again &#8211; at which point it will try to connect once more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mapping a drive with subst<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">To create a new mapping:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>subst x: c:\\folder<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">To remove a mapping:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>subst x:  \/D<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Mapping a drive with net use<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">To create a new mapping:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>net use x: \\\\localhost\\c$\\Folder\\Example<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">To remove a mapping:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>net use x: \/delete<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A little while ago, I needed to simulate the File Explorer presentation of a network share in order to illustrate a point to a very non-technical customer of mine. Luckily, this is very easily accomplished through the use of either the subst or net use command line commands. The difference between the two commands is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","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_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[615,677],"tags":[299,1273,862,1272],"class_list":["post-5620","post","type-post","status-publish","format-standard","hentry","category-how-to-2","category-tips-tricks","tag-command-line","tag-drive-letter","tag-net-use","tag-subst"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p2ukSU-1sE","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3736,"url":"https:\/\/www.razumny.no\/?p=3736","url_meta":{"origin":5620,"position":0},"title":"Resolving Error 1312 when mapping a folder on a network share","author":"Aleksander Nordgarden-R\u00f8dner","date":"22\/08\/2016","format":false,"excerpt":"Some time ago, I was talking to a user on the phone, while\u00a0remotely controlling their computer. I needed to connect to a folder on a network share\u00a0as my admin account, rather than that of the logged-in user, but kept running into the following error: Error 1312: A specified logon session\u2026","rel":"","context":"In &quot;How To&quot;","block_context":{"text":"How To","link":"https:\/\/www.razumny.no\/?cat=615"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4027,"url":"https:\/\/www.razumny.no\/?p=4027","url_meta":{"origin":5620,"position":1},"title":"Access UNC paths from the Windows command line","author":"Aleksander Nordgarden-R\u00f8dner","date":"04\/02\/2019","format":false,"excerpt":"I am, with surprising regularity, faced with the need to access UNC paths\u00a0from the command line, as that is perhaps pretty much the quickest way to browse to network shares with a different user than the one currently logged in. There's just one issue: the Windows command line does not\u2026","rel":"","context":"In &quot;How To&quot;","block_context":{"text":"How To","link":"https:\/\/www.razumny.no\/?cat=615"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2672,"url":"https:\/\/www.razumny.no\/?p=2672","url_meta":{"origin":5620,"position":2},"title":"Disconnect non-mapped drive","author":"Aleksander Nordgarden-R\u00f8dner","date":"12\/01\/2015","format":false,"excerpt":"From time to time, I have been\u00a0unable to connect to the UNC path of a network share. The error message I\u00a0get is: This usually happens when I am remotely connected to another user's computer. The message is straight-forward enough;\u00a0so, too, is the solution. You\u00a0simply need to disconnect from the share.\u2026","rel":"","context":"In &quot;How To&quot;","block_context":{"text":"How To","link":"https:\/\/www.razumny.no\/?cat=615"},"img":{"alt_text":"The network folder specified is currently mapped using a different user name and password","src":"https:\/\/i0.wp.com\/www.razumny.no\/wp-content\/uploads\/error.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":103,"url":"https:\/\/www.razumny.no\/?p=103","url_meta":{"origin":5620,"position":3},"title":"Installing printers using a batch script","author":"Aleksander Nordgarden-R\u00f8dner","date":"03\/11\/2008","format":false,"excerpt":"Part of my job is installing printers for users. Now, I could just go on mapping the printserver and finding the printer from there, but that takes a lot of time, as we have some 100 plus printers per printserver. Instead, I spent an hour creating batch scripts, and have\u2026","rel":"","context":"In &quot;script&quot;","block_context":{"text":"script","link":"https:\/\/www.razumny.no\/?cat=507"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17,"url":"https:\/\/www.razumny.no\/?p=17","url_meta":{"origin":5620,"position":4},"title":"Changing drive letter","author":"Aleksander Nordgarden-R\u00f8dner","date":"03\/04\/2008","format":false,"excerpt":"At times you might want to ensure that, no matter how many drives you have attached to you computer, when you attach a specific one, it'll always show up with the same driveletter. You might wish to do this for backup-purposes, or for automization purposes, or for whatever other reasons\u2026","rel":"","context":"In &quot;Windows XP&quot;","block_context":{"text":"Windows XP","link":"https:\/\/www.razumny.no\/?cat=32"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":106,"url":"https:\/\/www.razumny.no\/?p=106","url_meta":{"origin":5620,"position":5},"title":"Essential Console commands in Linux","author":"Aleksander Nordgarden-R\u00f8dner","date":"10\/11\/2008","format":false,"excerpt":"Having once again forgotten most of the commands I use in the command shell in Linux in general and Ubuntu especially, I did a quick google search, which turned up this thread at the Ubuntuforums. The thread had two amazingly useful links, both of which referred to quick reference cheat\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.razumny.no\/?cat=108"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts\/5620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5620"}],"version-history":[{"count":3,"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts\/5620\/revisions"}],"predecessor-version":[{"id":5632,"href":"https:\/\/www.razumny.no\/index.php?rest_route=\/wp\/v2\/posts\/5620\/revisions\/5632"}],"wp:attachment":[{"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.razumny.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}