idleherb
idleherb

Reputation: 1101

Open Windows 7 "Map Network Drive" Dialog programmatically

I am trying to open the dialog which is manually accessible through "Computer > Map Network Drive" on Windows 7. Is there any programmatic way to open it directly, e.g. with VBScript or PowerShell commands (not by firing mouse or keyboard events)? I am aware of net use ... shell command, but I specifically want to display that dialog.

Upvotes: 3

Views: 1557

Answers (2)

Knuckle-Dragger
Knuckle-Dragger

Reputation: 7046

Use rundll32.exe to pop the GUI from a script. It behaves just as if you clicked the button.

RUNDLL32 SHELL32.DLL,SHHelpShortcuts_RunDLL Connect

enter image description here

Link included for additional tricks. Map Network Drive is #24 on the list.

http://www.robvanderwoude.com/rundll.php

Upvotes: 6

Related Questions