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: \\192.168.1.52\xrays
net use s: \\192.168.1.52\common
net use p: \\192.168.1.52\public
net use o: \\192.168.1.52\office
net use y: \\192.168.1.52\drives
EXIT

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

1 Answer 1

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

EXIT
share|improve this answer
1  
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

Your Answer

 
discard

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.