Multi Commander > Feature Requests and Suggestions
Map Network Drive Wizard
Mathias (Author):
Create a User Defined Command of type "External"
Paste that into that command.
Save it..
Press "Hotkey" and assign the hotkey you want to that command
Tom:
Done. F11 now starts the Map Network Drive Wizard.
Does anybody knows how to start the Disconnect Network Drive Wizard? Unfortunately the command
rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL Disconnect
does not work anymore in newer Windows versions.
Mathias (Author):
I Don't know how to show the UI, But you can always script it :)
--- Code: ---net use <device> /delete
--- End code ---
But you will have to provide the device to unmount as a paramter to the script.
Or just create a script for each drive you normally mount and add them to its own menu command..
Tom:
As I already wrote, a right-click on a drive letter in MC drive bar will show the disconnect command for this single drive. So it's already possible to disconnect from MC.
Anyway, other Commander use F12 to launch the "Disconnect Network Drive Wizard" (e.g. Altap Salamander, DoubleCmd). So I'm familiar with this key. And you can disconnect several drives at once from the wizard.
As far as I found hints, usually the WNetDisconnectDialog function (https://msdn.microsoft.com/en-us/library/windows/desktop/aa385440(v=vs.85).aspx) is used to launch the disconnect wizard but since Windows 2003 exists no more connection to the shell32.dll, so it cannot be launched from Rundll32. Instead it's related to mpr.dll.
Tom:
Found a quick and dirty way to launch the disconnect wizard with F12 with help of a small AutoIt script.
Create a file called DisconnectDialog.au3 with the following lines:
Local $hWnd = WinGetHandle ("[CLASS:MultiCommander]")
#include <WinNet.au3>
_WinNet_DisconnectDialog( $hWnd )
WinWaitActive( $hwnd)
WinClose($hWnd)
Exit 1
Then compile this with Aut2exe.exe. This creates a file called DisconnectDialog.exe. This executable opens the disconnect wizard, which works as expected. Unfortunately this exe never ends. It just pauses the script. In the system tray an AutoIt icon called DisconnectDialog.exe is still running. If you run this exe several times you'll have several AutoIt icons in the system tray. I found no way to auto-terminate the AutoIt script from the script itself.
So I also created a batch called DisconnectDialog.cmd with the lines:
@echo off
taskkill /F /IM "DisconnectDialog.exe" > NUL:
start DisconnectDialog.exe
If DisconnectDialog.exe was started before, the process is killed. To see no error message in case that no old process DisconnectDialog.exe exists I send the output of the taskkill command to nirwana.
Put the two files DisconnectDialog.cmd and DisconnectDialog.exe in a directory found in path (e.g. C:\Windows). Then just create a user defined command which runs DisconnectDialog.cmd and define a hotkey F12 for this.
So you could run the disconnect wizard as often as you want but you will have at max only one AutoIt icon in system tray.
Anyway, would be better if these wizards would be included as commands in MC in a future version.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version