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.

Is there a way of mounting certain drives with NET USE only when you're connected to certain networks? I use this particular laptop at home and at work. When I am at home and connect to the network there, I'd like to automatically mount some samba shares that are present.

At the moment I use the /persistent flag. If one of the home shares gets selected by accident or a program attempts to scan it whilst I am at work, Explorer tends to hang.

Is there a way around this?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You may be able to do that with Scheduled Tasks in Windows 7. It has triggers for startup / login and can run jobs only if networks are available (Conditions-> Start only if the following network connection is available). Create a script with net use and have the Task Manager run it when the conditions are right.

share|improve this answer
add comment

You can use NetProfiles who can easily do the mount itself. However you'll need to choose which profile to run on any of the networks you connect

share|improve this answer
add comment

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.