Network Drive .bat Mapping Help

Associate
Joined
3 Jan 2006
Posts
2,073
Location
Bishopsworth, Bristol
Hi Guys,

I'm having some trouble creating a working batch file that will map a network drive automatically. I have been using the net use \\PATHHERE PASSWORD /user:USERNAMEHERE syntax, but to no avail. The script runs, and closes and the drive doesn't map. The path, username and password are definitely correct.

If I remove the password and /user: parts, it does prompt me for a username and password in the CMD window so it's trying to do something. I've tried it on two machines.

This share I am trying to map is a share from a internet storage account (Strato HiDrive), which allows normal mapping when going through the Tools > Map Network Drive route.

Is there anything I'm doing wrong?

Thanks,
Jake
 
Code:
NET USE DRIVELETTER: "\\host\path1\path2" /USER:DOMAIN\USERNAME PASSWORD

Example:

Code:
NET USE X: "\\OCUKDC001\Finance\Invoices" /USER:OCUK\schase Sup3rs3cur3cl3artextp4ssword!

You cannot use conflicting credentials. For example if you are connected to OCUKDC001 for your user roaming profile with your domain login you could not then connect to another share on the same server with a different login.

A common mistake is to append a \ to the path you want to map to such as:

\\host\path1\path2\

This will not work and present a "Network path cannot be found" error.
 
Last edited:
Net use z: \\server\directory /savecred /persistent:y

Lets you put in the user details when you first connect and saves them and then reconnects every time the machine is restarted.

MW
 
Thanks for the responses, it's much appreciated. I've tried a mixture of the above, and it still doesn't seem to map. Is it because it's an internet drive, hosted elsewhere? It's not on our network.

I've tried a software package called Network Drive Manager, and that seems to work.

Thanks again,
Jake
 
Back
Top Bottom