Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following batch script which is successfully mapping a few of our drives for our users:

@echo off
net use * /delete /yes
net use x: \\\xrays
net use s: \\\common
net use p: \\\public
net use o: \\\office
net use y: \\\drives

The mapped drives are taking their names from the share name themselves. However, it would be really handy if I could override the name to something more useful to the users.

I have looked at quite a few documents online with examples of the net use commands, but I can only see options such as credentials but nothing to do with the naming.

The script is being run on Windows XP and Windows 7 workstations.

Any help would be appreciated.

share|improve this question
add comment

1 Answer

@echo off
echo --------------------------delete map drive all------------------------
net use * /delete /yes
echo ------------------create drive --------------------------------
net use m: \\\Source /user:aleg\masr masr2006*
net use n: \\\scanner_bat_test /user:alwq\4288044 masr2006*
echo ---------------------------------------------------

share|improve this answer
Welcome to Super User! Please edit your post and explain what the code does exactly. Also check our formatting help and use the preview to take a look at your posts before submitting. You have to indent code by 4 spaces. –  slhck Dec 16 '12 at 11:20
Thanks, could you explain what each line does. It's hard to distinguish which parts are the passwords and drive names etc. –  dannymcc Dec 17 '12 at 0:05
add comment

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.