1

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

1

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

https://social.technet.microsoft.com/Forums/en-US/winservergen/thread/048e504d-c8d5-4eae-b5a5-e367797a2bca/

http://support.microsoft.com/kb/297684

0

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.

Cheers

0

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 must log in to answer this question.

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