X
X
The Best Tech Newsletter Anywhere

Join 250,000 subscribers and get a daily digest of news, geek trivia, and our feature articles.

How to Map Network Drives Using PowerShell

image

In years past, automating network drive creation required the use of primitive batch files, luckily for us you can now do it through PowerShell.

Note: this tutorial expects that you are using PowerShell 3.0.

How to Map Network Drives Using PowerShell

Prior to the PowerShell era, we could map networks drives using a batch file that contained a net use command:

net use M: \\touchsmart\Share /Persistent:Yes

sshot-0

To do it in PowerShell, press the Win + R keyboard combination to bring up a run box, then type powershell and hit enter.

sshot-1

The Cmdlet we are looking for is New-PSDrive, but most importantly you need use the -Persist switch.

New-PSDrive –Name “K” –PSProvider FileSystem –Root “\\touchsmart\share” –Persist

Just change the name to a valid (not in use) drive letter and point the root parameter to a valid network share.

sshot-2

That’s all there is to it.

Taylor Gibb Taylor Gibb
Taylor Gibb is a professional software developer with nearly a decade of experience. He served as Microsoft Regional Director in South Africa for two years and has received multiple Microsoft MVP (Most Valued Professional) awards. He currently works in R&D at Derivco International.
Read Full Bio »

The above article may contain affiliate links, which help support How-To Geek.
How-To Geek is where you turn when you want experts to explain technology. Since we launched in 2006, our articles have been read more than 1 billion times. Want to know more?

x

The Best Tech Newsletter Anywhere

Join 250,000 subscribers and get a daily digest of news, comics, trivia, reviews, and more.