I've been tearing my hair out trying to get Windows to remember the credentials to a network share, and almost all attempts were completely fruitless.

I have two Windows machines, one being a media center that is supposed to access content on the other, but every time it fails to remember the credentials and requires a manual login to the remote share to get things going.

I tried various thing. Adding the credentials to Credential Manager, trying to change the NTLP security level, changing the username/passwords of the two machines to match, and I'm sure I tried other things too, nothing worked.

link|improve this question

43% accept rate
feedback

2 Answers

Use NET USE with \savecred and \persistent:yes to permanently save the credentials

net use \\Hostname /savecred /persistent:yes

link|improve this answer
I tried that and had no luck, hence the last resort of authenticating at startup. I assume your solution should work when Windows isn't being evil, so +1 – Acorn Jul 12 '11 at 13:22
what output/error message you got ? – Revolter Jul 12 '11 at 13:26
There's no error message, just after rebooting the credentials are not remembered and you need authenticate again. – Acorn Jul 12 '11 at 15:00
feedback

I eventually managed to come up with something that worked!

You need to automatically authenticate to the share each time the machine is started, which can be done with a batch script.

This is what you need in your script:

net use \\theremotemachine ThePassword /user:Username

Based on info from here and here.

Now, I didn't have any luck getting this working using task scheduler for some reason, so I ended up using a program called hstart. It allows you to launch hidden batch scripts.

I created a shorcut, put it in the Startup folder, and changed the Target to:

C:\hstart.exe /NOCONSOLE “C:\script.bat”

And there you go, there should now be no problems accessing the shared folders on the remote machine.

I think there may be a problem if the other machine isn't on when the script runs, but I'm not sure how you could get around that..

Hope someone else finds this useful.

link|improve this answer
You can also add /persistent:yes at the end of your net use command. – jftuga Jul 12 '11 at 12:51
I tried that and it would still forget the credentials :( – Acorn Jul 12 '11 at 13:18
There will be an event under the Event Viewer I would check there. – surfasb Jul 12 '11 at 22:05
feedback

Your Answer

 
or
required, but never shown

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