Windows: Map network drives from csv

Even back in my olden days of using a non-free operating system, I was automating my tasks. The non-persistent sessions at the computer science lab required that I script my tasks. This is what I came up with for mapping network drives.

You can set a csv file with the following contents:


So it’s not a real csv file; it’s got headers delineated by “SERVER” and a server name. The script will operate on the following lines, until the next “SERVER” line. It will mount the drive letter, from the following CIFS share, using a username and password or prompting if blank, and a pretty name. It will only mount those entries, if the SERVER actually is reachable. So it fails safely if you are on a different network than the requested server at the time.

The script is available on my gitlab. And that example csv is also there.

I eventually scrapped this script when I deployed an Active Directory domain and I used group policy to define a number of mounts to define.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.