0

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.

user2741620
  • 305
  • 2
  • 7
  • 21

1 Answers1

1

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
Justin Ryan
  • 1,409
  • 1
  • 12
  • 25
  • Hi! Thanks very much. I slightly changed the code and it works! Dim ret As Integer = WNetConnectionDialog(Nothing, 1) – user2741620 Nov 13 '14 at 04:09