Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using the following code to mount a network drive in a script that configures desktop icons and favorites by copying them when the user logs into windows.

NET USE W: \\Server\Files\IT\auto /user:"DOMAIN\username" "password"

I have read the question How to mount a drive with read only permission but it's asking about linux.

Does anyone know how to mount a network drive as read only via script?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You'll want to set the permissions on the share such that it only allows read access. This is something that can be done pretty easily. If you've got a share right click on the folder, and select properties. enter image description here

Go to the sharing permissions tab and select "permissions" then uncheck all boxes except the read box for that user (or group.)

enter image description here

share|improve this answer

Do it via permissions on the 'server', not only am I not sure you can force it via NET USE (nothing leapt out at me via Google anyway) but why would you want to do it this way?

share|improve this answer
    
Because I don't have access to the server at the moment. Thanks for the answers. I'll do it the right way. ;) –  Kalamane Jun 15 '11 at 16:32
3  
Another reason might be that normally you have write access to the server through that share, but you want to make sure you are not going to change something inadvertently this time. Too bad Windows does not allow this. In Unix you can do mount -r. –  Carlos A. Ibarra Feb 22 '12 at 15:52

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.