locked
how to open a directory in vb.net RRS feed

  • Question

  • hi just want to know how to open a directory in vb.net.

     for example i want to open  C:\wamp\www with just a click form a button. can you help me to do this. hope you can help me. t

    Wednesday, September 7, 2011 8:32 AM

Answers

  • hi just want to know how to open a directory in vb.net.

     for example i want to open  C:\wamp\www with just a click form a button. can you help me to do this. hope you can help me. t

    Put this code in Button Command

    Process.Start("C:\wamp\www")

     

    thanksyou


    www.shariqdon.com
    • Proposed as answer by Paul P Clement IV Wednesday, September 7, 2011 12:09 PM
    • Marked as answer by Kee Poppy Thursday, September 15, 2011 8:59 AM
    Wednesday, September 7, 2011 9:26 AM
  • If you're just intending to launch a folder using Windows Explorer through your button click (eg: you have Button1 on your form):

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Process.Start("explorer.exe", "c:\temp")
    End Sub

    HTH.


    Best regards, Saygılarımla, Onur Güzel

    Yazgeliştir Forumları VB.NET / C# Süper Moderatorü.

    Microsoft Haber Grupları Profilim (VB.NET)


    • Edited by Onur Güzel Wednesday, September 7, 2011 9:29 AM
    • Proposed as answer by Paul P Clement IV Wednesday, September 7, 2011 12:09 PM
    • Marked as answer by Kee Poppy Thursday, September 15, 2011 8:59 AM
    Wednesday, September 7, 2011 9:28 AM

All replies

  • What do you mean with Open?

    A folder can be choosen, but mostly that is only related to a write or read action.

    Open a directory does not exist (although it is used in relations with show dialogs of the folders) 

    'VB10SP1 style code for older versions add the byval

        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            Dim ofd As New OpenFileDialog
            If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
                'Do Something
            End If
        End Sub
    


     

     


    Success
    Cor
    • Edited by Cor Ligthert Wednesday, September 7, 2011 8:41 AM
    • Proposed as answer by Murugan A Wednesday, September 7, 2011 9:20 AM
    Wednesday, September 7, 2011 8:40 AM
  • hi just want to know how to open a directory in vb.net.

     for example i want to open  C:\wamp\www with just a click form a button. can you help me to do this. hope you can help me. t

    Put this code in Button Command

    Process.Start("C:\wamp\www")

     

    thanksyou


    www.shariqdon.com
    • Proposed as answer by Paul P Clement IV Wednesday, September 7, 2011 12:09 PM
    • Marked as answer by Kee Poppy Thursday, September 15, 2011 8:59 AM
    Wednesday, September 7, 2011 9:26 AM
  • If you're just intending to launch a folder using Windows Explorer through your button click (eg: you have Button1 on your form):

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Process.Start("explorer.exe", "c:\temp")
    End Sub

    HTH.


    Best regards, Saygılarımla, Onur Güzel

    Yazgeliştir Forumları VB.NET / C# Süper Moderatorü.

    Microsoft Haber Grupları Profilim (VB.NET)


    • Edited by Onur Güzel Wednesday, September 7, 2011 9:29 AM
    • Proposed as answer by Paul P Clement IV Wednesday, September 7, 2011 12:09 PM
    • Marked as answer by Kee Poppy Thursday, September 15, 2011 8:59 AM
    Wednesday, September 7, 2011 9:28 AM