Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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.

share|improve this question
up vote 3 down vote accepted

/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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.