I have made a connection to a remote server via IPC$. Now I want to open the d$ share (\\server\d$) in a windows explorer type window via the click of a button on my form. Any ideas....
Printable View
I have made a connection to a remote server via IPC$. Now I want to open the d$ share (\\server\d$) in a windows explorer type window via the click of a button on my form. Any ideas....
Never mind figured it out. Shell out and call Explorer \\computer\d$.
It would be a better idea to use ShellExecute instead of Shell.
Also, it's simple to select between Open and Explore this way:
Code:Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub cmdOpen_Click()
Call ShellExecute(0, vbNullString, vbNullString, vbNullString, "\\server\d$", vbNormalFocus)
' Also works: Call ShellExecute(0, "Open", vbNullString, vbNullString, "\\server\d$", vbNormalFocus)
End Sub
Private Sub cmdExplore_Click()
Call ShellExecute(0, "Explore", vbNullString, vbNullString, "\\server\d$", vbNormalFocus)
End Sub