2

I have a storage machine that is usually offline. When I want to use it, I WOL it and then access its drives. A drive from that machine is mapped to Windows 10.

When that machine is offline, Windows 10 will keep trying to access that drive and freeze up explorer (and other applications when a file chooser needs to be drawn) for a minute or so until it realises the drive is offline.

I would prefer it to completely give up on that drive until I manually double click on that drive or something.

Is it possible?

I don't want to Windows to cache any of the remote machine's content, so offline files feature probably isn't going to cut it.

Asu
  • 121
  • 1
  • 3

1 Answers1

0

You should disconnect the drive in Windows Explorer (right-click on it) so Windows will not try to map the drive at logon.

Then, use a batch file to add the drive when you need it, with persistent:no to prevent Windows from remembering it:

net use x \\server.domain.net\share /persistent:no
explorer x:
Swisstone
  • 6,725
  • 7
  • 22
  • 32
  • Unfortunately this seems to have the same effect as soon as the other machine goes offline. Explorer keeps trying the drive in the same fashion over and over again, causing other applications to freeze when I open a file chooser for a minute. As far as I understand, /persistent:no just makes the drive unmount upon reboot. Having to both manually map and unmap it every time isn't really the comfortable solution.. I was hoping something as simple as a quick timeout setting would be available.. – Asu Jul 14 '19 at 16:50
  • OK, I see, so you can try to adjust the `SessTimeout` here: `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters` create the following DWORD: `SessTimeout` give it a value in seconds, then, reboot. After this delay, the client should stop trying. Timeouts are described here: https://blogs.msdn.microsoft.com/openspecification/2013/03/27/smb-2-x-and-smb-3-0-timeouts-in-windows/ – Swisstone Jul 14 '19 at 17:36
  • Hmm either Windows ignores this altogether or has some hidden minimum value for it. I set it to 5, but the timeout is still about 30 seconds (did a reboot just to confirm) – Asu Jul 15 '19 at 19:09
  • @asu does the issue still persist after these years? – djdomi Apr 08 '22 at 17:44
  • 1
    @djdomi I have stopped trying as I found no solution sadly. – Asu Apr 08 '22 at 22:22
  • @asu swisstone answer is correct. You can only cheat by using a batch that pings the target and then run the command. – djdomi Apr 09 '22 at 07:45