Results 1 to 3 of 3

Thread: Open a network computer UNC path in explore

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119
    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....

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Location
    Dayton, OH USA
    Posts
    119
    Never mind figured it out. Shell out and call Explorer \\computer\d$.

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width