how to open the windows explorer map network

231 views Asked by At

Windows Explorer - Map Network Drive

Hi All,

I need to be able to open the [Windows Explorer - Map Network Drive] popup using either VB or cmdlet. I tried using the code in both VB and cmdlet:

System.Diagnostics.Process.Start("rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL Connect")

But it does not work.

Any help is appreciated. Thank you.

1

There are 1 answers

1
Justin Ryan On BEST ANSWER

A little bit of library magic:

Private Declare Function WNetConnectionDialog Lib "mpr.dll" (ByVal hwnd As Long, ByVal dwType As Long) As Long

Dim ret As Integer = WNetConnectionDialog(Me.hwnd, 1)    'ret is 0 on success