We help IT Professionals succeed at work.

Disconnecting mapped drives once

486 Views
Last Modified: 2010-04-16
I am looking for a batch script that can be run as a logon script. the script would disconnect specified network drives eg o:\ or t:\ drives at the next logon. I would want it to just run once for all users.

i need to do this as we share laptops at our school among teachers at our school and they have drives mapped to the students in their classes folders. Normally I re-ghost all the computers each year so the my mapped drive batch script maps the correct student folders on the server for that teacher. However when I change the batch script  for the mapped drives if given teacher has already logged onto a computer it still shows the old mapping. I would not want it to unmap and remap drives every time they log on as this a once a year issue and I assume that the 'un-mapping' and 're-mapping' increases startup time.

thanks

John
Comment
Watch Question

Top Expert 2007
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
So I understand that this would delete the mapped drive. What does the >Nul 2>&1 do?

thanks
Top Expert 2007

Commented:
That suppresses all the output that can occur from the command. The >NUL suppresses the standard output. This would be something like drive deleted or whatever. The 2>&1 directs the standard error to the standard output (and thus to NUL) so that error messages are suppressed like drive not mapped.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Top Expert 2007

Commented:
All grades given should be A's... EE grading is ridiculous as it effects the experts points...

Author

Commented:
how does it affect the points? Do you get less if the grade is not A?

I always grade based on how well my problem was resolved....  which is part to do with how well I ask it I guess,.....
Top Expert 2007

Commented:
Check out:

https://www.experts-exchange.com/help.jsp#hi20

In MHO, you can grade the answer(s), but that shouldn't affect the points... It's ridicules.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.