<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mounting a Virtual/Network Drive with PowerShell</title>
	<atom:link href="http://www.brangle.com/wordpress/2009/08/mounting-a-virtual-network-drive-with-powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brangle.com/wordpress/2009/08/mounting-a-virtual-network-drive-with-powershell/</link>
	<description>Just another computer weblog</description>
	<lastBuildDate>Thu, 26 Aug 2010 23:26:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Aleksandar</title>
		<link>http://www.brangle.com/wordpress/2009/08/mounting-a-virtual-network-drive-with-powershell/comment-page-1/#comment-57</link>
		<dc:creator>Aleksandar</dc:creator>
		<pubDate>Thu, 27 Aug 2009 12:49:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.brangle.com/wordpress/?p=251#comment-57</guid>
		<description>When you use the subst command to map a drive letter to a local folder, the mapping disappears when you log off.

To make it persistent (to survive logins and reboots), you need to modify the registry. Add a string (REG_SZ) value to:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

Set the name of the value to the drive letter (e.g. M:), and the data to:

\??\C:\folder\subfolder

This PowerShell one-liner will do that for you:

Set-ItemProperty &#039;HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices&#039; -name &quot;M:&quot; -value &#039;\??\C:\folder\subfolder&#039;

According to some articles on Web, the drive letter should be immediately available to you, but when I&#039;ve tested it, a restart was required to make it available to all users.

Btw, to mount local folder as PowerShell drive:

New-PSDrive -name scripts -psprovider FileSystem -root &#039;C:\Documents and Settings\username\My Documents\WindowsPowerShell\Scripts&#039;

cd scripts:

This also works for UNC path:

New-PSDrive -name N -psprovider FileSystem -root &#039;\\server\share&#039;

cd N:

PowerShell drives are visible only in PowerShell session. If you want some virtual drives to be available every time you work in PowerShell, add a command to your profile.</description>
		<content:encoded><![CDATA[<p>When you use the subst command to map a drive letter to a local folder, the mapping disappears when you log off.</p>
<p>To make it persistent (to survive logins and reboots), you need to modify the registry. Add a string (REG_SZ) value to:</p>
<p>HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices</p>
<p>Set the name of the value to the drive letter (e.g. M:), and the data to:</p>
<p>\??\C:\folder\subfolder</p>
<p>This PowerShell one-liner will do that for you:</p>
<p>Set-ItemProperty &#8216;HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices&#8217; -name &#8220;M:&#8221; -value &#8216;\??\C:\folder\subfolder&#8217;</p>
<p>According to some articles on Web, the drive letter should be immediately available to you, but when I&#8217;ve tested it, a restart was required to make it available to all users.</p>
<p>Btw, to mount local folder as PowerShell drive:</p>
<p>New-PSDrive -name scripts -psprovider FileSystem -root &#8216;C:\Documents and Settings\username\My Documents\WindowsPowerShell\Scripts&#8217;</p>
<p>cd scripts:</p>
<p>This also works for UNC path:</p>
<p>New-PSDrive -name N -psprovider FileSystem -root &#8216;\\server\share&#8217;</p>
<p>cd N:</p>
<p>PowerShell drives are visible only in PowerShell session. If you want some virtual drives to be available every time you work in PowerShell, add a command to your profile.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
