# How To Create A Windows Server 2003 Permanant UNC/Mapped Drive

I have been looking around at various question and help sites but still need some clarification on how to create either a Windows share or find documentation on how to specify the correct UNC path that can exist across logins.

It appears that using net use with /persistent:yes will accomplish this, but I have also seen some answers in stackoverflow.com that also indicate uncertainty with this answer.

Basically, I want to use pscp.exe to pull a file off a Linux SAMBA share and send it somewhere. I can temporarily create shared drive x: while I'm logged in, but would like to know how to make this permanent.

-
add comment

## 1 Answer

/persistent:yes will cause the share to persist across logins, in exactly the same way as the "Reconnect at logon" checkbox in the Windows Explorer "Map Network Drive" dialog. You'd want to do something like:

net use x: \\path\to\target /persistent:yes


which would set up the share in the way you've got in mind.

However! I know of no good way to cache credentials for the share when doing this from the command line; /savecred seems like it should do that, but you can't specify it with /persistent and frankly I'm not sure how it's supposed to work. This being the case, you may be better advised to open up Windows Explorer and use View -> Map Network Drive, which will both offer the "Reconnect at logon" (i.e., /persistent) option, and allow you if necessary to specify credentials, which will then be cached and used when the share is reconnected.

-
add comment