# Mapping Network drives using encrypted passwords



## noyzy (May 17, 2008)

Hey, just a quick question.
Over the past I have always created a batch file and dropped it in the startup of a windows machine to map a network drive using a username and password like so:

net use <Allocated Drive Letter> \\server\sharedFolder /user:<username> <password>

e.g
net use P: \\192.168.1.10\pictures /user:noyzy password123

Of course I do not like the idea of storing passwords as plain text in a batch file though so I was wondering what alternative methods there are to complete this task without saving my passwords as plain text.

I just tried the Tools ==> Map Network drive in Windows XP and selected "Connect using a different username" and tried to setup the username and password there but after a restart it does not seem to use these credentials to map the share as I still get asked to enter the username and pass.

Noyzy


----------



## johnwill (Sep 26, 2002)

Don't know of any alternatives. I presume that trying to make the connection persistent didn't work?

Try this command once and then reboot and see if the mapping is restored after the boot without running this again.

net use P: \\192.168.1.10\pictures /user:noyzy password123 /PERSISTENT:YES


----------



## noyzy (May 17, 2008)

Thanks for the reply. 
I tried adding the /PERSISTENT:YES switch as you said but after a restart the password is not remembered and a new net use with username and password is required (or entering a password when asked after trying to acess the drive through My Computer etc).

Any other ideas?

##################################################

I have also noticed a problem with outlook accessing the share...

I have my PST file stored on a share that I map as Z: drive. (the location is then Z:\Outlook\outlook.pst)

Say I have just disconnected all my Maps (net use * /DELETE)
ReMapped my Z: Drive (net use Z: \\192.168.1.10\ben /user:noyzy password123 /PERSISTENT:YES)

Restarted my computer

Now if I try to open outlook it says the path of my pst is not valid.

So I check and find that Z: drive is mapped but requires a password if try and descend into it via My Computer. 
So I do not enter my password through the GUI prompt windows give me here yet. Instead I enter (net use \\192.168.1.10 /user:noyzy password123) to allow me access to the server. 
Now I try and open outlook... Same error saying the path is not valid.

on a net use command it returns:

Status Local Remote Network

--------------------------------------------------------------------------
Unavailable Z: \\192.168.1.10\ben Microsoft Windows Network
OK \\192.168.1.10\IPC$ Microsoft Windows Network
The command completed successfully.

*Note the Unavaliable on Z

Now as soon as I try and descend into my Z: Drive from My Computer it lets me in since I entered my net use /user command before.

This then fixes the problem (decending into the Z: drive through MY Computer fixes the problem of not being able to open outlook) as now the net use command returns:

Status Local Remote Network

--------------------------------------------------------------------------
OK Z: \\192.168.1.10\ben Microsoft Windows Network
OK \\192.168.1.10\IPC$ Microsoft Windows Network
The command completed successfully.

No more "UNAVALIABLE" and outlook opens correctly.

Any ideas on "this" one too would be greatly appriciated.

Its like even though its mapped and has a username and pass connected to it it still needs to be refreshed or accessed before outlook can access it.

Regards

Noyzy


----------

