Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .