Subscribe

Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts

Search

Archives

Get Windows to Remember Network Share Passwords

Post image for Get Windows to Remember Network Share Passwords

by Steve Wiseman on July 21, 2011 · 10 comments

in Command Line,Microsoft


.

We have a fax server here that drops all of its incoming faxes to a shared folder. Unfortunately, because of the way it was designed it cannot be joined to our local domain.

This means it has its own local account, and every time I reboot a username and password has to be entered to access it.

Cache Windows Share Passwords

I wanted to find a way to allow me to access the drive without having to enter a username and password.

After some searching, I found a command line tool built into Windows that will do this:

cmdkey

This will allow you to store multiple username and password combinations for different network resources, while keeping them encrypted in the registry.

So, in my case I have a fax server on 10.10.27.231, and its username is fax, the password is fax.

To add it to Windows simply type this at the command line:

cmdkey /add:10.10.27.231 /user:fax /pass:fax

If you wanted to remove it from the cache, you would call it like this:

cmdkey /delete:10.10.27.231

Also, you can get a list of the currently remembered ones like this:

cmdkey /list

A simple command line tool, but saves you the aggravation of typing that in every time you reboot – Nice.

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 10 comments… read them below or add one }

1 David Chang July 21, 2011 at 5:17 pm

What about Windows XP. I typed this at the command line and notice that it does not recognize the command.

2 Steve Wiseman July 21, 2011 at 5:18 pm

Hello David,

I did a quick check and you are correct – it is not in Windows XP. I believe if you can find a Windows 2003 server machine you can copy it from c:\windows\system32\cmdkey.exe

Have not had time to test and see if it works under XP.

3 Inger Paul July 21, 2011 at 5:20 pm

Thanks for the tip steve. Timely post since I was looking for something just like this. I have a document server that are users access all the time, and I don’t want to give the password out but at the same time they need read-only access. This is the perfect solution. Just wish the doc server could just be on the domain!

4 Jen July 21, 2011 at 5:21 pm

Thanks for the article Steve. Always appreicate them 🙂

5 Steve Wiseman July 21, 2011 at 5:21 pm

Glad to hear it Inger

6 Steve Wiseman July 21, 2011 at 5:22 pm

No problem Jen.

7 Morten Madsen August 16, 2011 at 4:18 am

Thanks for the article Steve. 🙂

8 Trevor June 20, 2013 at 1:39 pm

I have a Windows 8 machine that has to login to the Windows 2003 server every time they restart their machine. Would I run this on the server or the client machine?

9 Steve Wiseman June 21, 2013 at 1:10 am

You would need to run this on the client machine…not sure if it works with Windows 8, but I think it will.

10 sam April 9, 2014 at 1:05 am

cmdkey.exe not found in xp. Where can I found cmdkey.exe ?

Leave a Comment

Category Links - Windows Forum - Exchange Forum