Open the Windows 7 "Network Drive Map" program code
I am trying to open a dialog which is manually accessible via "Computer> Map Network Drive" in Windows 7. Is there any programmatic way to open it directly, eg. with VBScript or PowerShell commands (not by triggering mouse or keyboard events)? I know the net use ...
shell command , but I specifically want to display this dialog.
Use rundll32.exe to open the GUI from a script. It behaves the same as if you pressed a button.
RUNDLL32 SHELL32.DLL,SHHelpShortcuts_RunDLL Connect
Link included for additional tricks. The network drive map is # 24 in the list.
http://www.robvanderwoude.com/rundll.php
Try WNetConnectionDialog:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa385433%28v=vs.85%29.aspx
or WNetConnectionDialog1:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa385436%28v=vs.85%29.aspx