Any way to suppress the "Windows cannot access \\machine\share" error message?
September 25, 2012 7:40 PM   Subscribe

Is there any way to disable the "Windows cannot access \\machine\share" messages that pop up when a network connection disappears?

I often use VPN connections and browse files on remote machines using Windows Explorer. When I close my laptop lid those connections are terminated. When I wake my laptop again, I'm welcomed by lots of dialogs saying Windows cannot access the share anymore. It's a little tiresome to have to close all of them. Is there any way to suppress these messages? I'm using Windows 7.
posted by deo rei to Computers & Internet (7 answers total) 1 user marked this as a favorite
 
Best answer: I don't know if you can suppress them.

But if you buy and install a program called "Dialog Devil", you can set it up to automatically close those message for you.

The only thing about it is that if you're using Win7, it can't autostart. You have to run it manually every time you log in. If you hibernate and then awaken, it's still running though, and could close all those popups automatically.
posted by Chocolate Pickle at 8:14 PM on September 25, 2012


You can use the Offline Files feature to have your computer make a local copy of the files, which makes them available when you are not connected to that network share. I am pretty sure this suppresses the error messages (because Windows treats the connection failure as normal).

It does however put you at the mercy of Windows' File Sync feature, which at times will provide you the older, saved version of the file when there is a newer one available. And then you have to perform a manual file sync.

Working with network files when you are offline
posted by meowzilla at 9:11 PM on September 25, 2012


If you map a drive over a share, there's an option to restore the mapping at logon time; turn that off and Windows shouldn't pester you. As far as I know, there isn't any software that can work with a share via its UNC name but can't work via a mapped drive.

If you're using a consistent set of shares, you can use a simple cmd script to connect and/or map them and another to disconnect them before shutdown. Save the following as connect.cmd:

net use /persistent:no
net use \\machine\share /user:deorei *
net use \\machine\othershare
net use X: \\machine\shareforxdrive
net use \\anothermachine\share /user:deorei *
net use Y: \\anothermachine\shareforydrive

And the following as disconnect.cmd:

net use \\machine\share /delete
net use \\machine\othershare /delete
net use X: /delete
net use \\anothermachine\share /delete
net use Y: /delete

Make desktop or taskbar shortcuts to connect.cmd and disconnect.cmd and you can just click them to connect or disconnect.

The * on the lines that include /user forces a password prompt; you only need the /user switch on the first of any set of connections to a given server, since Windows won't let you connect to any server with multiple usernames within any given Windows session.

The net use /persistent:no line inside connect.cmd tells Windows not to attempt to reconnect network shares at logon time; if you'd rather just keep on connecting as you have been doing instead of using the scripts, just running that command once from a cmd window should suppress the behaviour that's currently annoying you.
posted by flabdablet at 4:28 AM on September 26, 2012


Thinking about this a little harder: if the issue is that the connections all break when the lid shuts because the machine going to sleep breaks the VPN tunnel, just run disconnect.cmd before closing the lid, then run connect.cmd after bringing the VPN back up.
posted by flabdablet at 5:03 AM on September 26, 2012


Response by poster: flabdablet, thanks for the suggestion to use commandline tools, I hadn't thought about that. I will examine I can trigger them automatically on sleep/wake because I almost never pass log on.

meowzilla, I should have mentioned I am on Home Premium, which doesn't support Offline Files. Also the share is too large to synchronize, although I imagine it might be possible to tweak the sync settings somewhere and still get the benefit you describe. Also from earlier experience on a different machine, it seems to get a little confused when shares are mounted via IP address.

Chocolate Pickle, Dialog Devil seems to do the job with only minor inconveniences (like foregrounding Explorer when it closes a dialog), and I'm not sure yet if it can distinguish between different kinds of Network Error dialogs, but I've installed it and will try it on for a while!

Thanks all!
posted by deo rei at 11:16 AM on September 26, 2012


Best answer: Free solution: AutoHotKey. I have a single script which, amongst many other things, constantly checks for particular dialog boxes and closes them or clicks OK or whatever in them to get rid of them. Sample code below - polls once a second and closes specified dialog box by clicking OK. You can just make the window close by replacing the ControlClick, OK with WinClose. More info on IfWinExist directive here. You can completely distinguish dialog boxes in the code, by their class, window title substring or substring of the contents of the dialog. AutoHotKey comes with a "window spy" tool that allows you to gather the information you subsequently incorporate into the code.

SetTimer, MsgBoxCheck, 1000
MsgBoxCheck:
;Autoclose TeamViewer Sponsored Session window
IfWinExist, Sponsored session, This was
{
ControlClick, OK
}
Return
posted by tra at 1:08 PM on September 26, 2012


Response by poster: I love AutoHotKey. Used it for years on my EeePC to remap keys and do some basic window management. Didn't think of using it here at all. Will have a look, thanks!
posted by deo rei at 2:06 PM on September 26, 2012


« Older I graduated with honors. Two different ways.   |   Foam or liqud soap? Newer »
This thread is closed to new comments.