I have two networks: work and home. The work subnet is 192.168.0.x whereas home's subnet is 192.168.1.x

At work I have two mapped drives but at home I don't have either. Any time I open explorer at home or mistakenly hover a file over those drives, windows hangs whilst attempting to connect to the drive. I'm currently using a script which decides whether or not to remove/map the drives based on whether or not can be pinged (work router). The problem is that for some reason based on the event trigger of "connecting/disconnecting to/from a network" multiple instances get run at once and just hang there.

All things considered I'd like a more elegant solution. Is there not a way of changing the timeout for mapped drives? Is it possible to have a 'set configuration' in windows where that configuration has permanently mapped network drives and another configuration doesn't have them at all; something like a 'hardware profile'? I also have other programs I'd like to turn on/off based on my network location.

3 Answers 3


I don't know about a "hardware profile" but we have shared network drives that are accessible anywhere via OpenVPN. If you have any control over your work's firewall, it seems like that would be the route to go.



I actually did a workaround; I found out how to merge networks (wireless and wired) so that I could finally use the task scheduler's 'conditions' in such a way that allowed me to run a script only when connected to work and run a separate 'disconnect' script when connected at home.

Both scripts are set to run on "workstation unlock" and are set to run as soon as the conditions are available even if it fails.

To merge networks if anyone is interested:

Go to "Network and Sharing Center"
Click on the icon for the network you're currently on (under "active networks")
Click "Merge or delete network locations" at the bottom of the popup window.


You can adjust the auto disconnect feature of the mapped network drive by issuing the command

net config server /autodisconnect:<NUMBER IN MINUTES HERE>

if you put -1 then it will disable it.

Look at these links for more information



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.