Map Letter Drives

In Windows you can map a network or local disk directory to a letter drive. I have found that I needed to do this recently because Windows doesn’t handle well directory names with spaces in them, even though the recommended folder for applications is C:\Program Files! When writing scripts that reference a directory path with a space you need to either escape the black space, quote the path, or map a letter drive to the application path.

To map or mount a letter drive to a network resources you can use the following command.

net use z: \\\\MY-SERVER\\PATH\\TO\\MAP

When the resource to map in your local disk drive you can use the following command.

subst z: c:\\PATH\\TO\\MAP

Technorati Tags: , , , , , , ,