Connecting Tech Pros Worldwide Forums | Help | Site Map

Open windows explorer from .NET desktop app

Mark
Guest
 
Posts: n/a
#1: Nov 21 '05
I'd like to open up Windows Explorer from my .NET desktop application to a
specific path. I essentially want to execute:

%Systemroot%\explorer.exe c:\somepath\

How can this be done? Thanks in advance.

Mark



Shariq Khan
Guest
 
Posts: n/a
#2: Nov 21 '05

re: Open windows explorer from .NET desktop app


Mark:

Imports System.Diagnostics

Class Explorer

Public Shared Sub StartExplorer(ByVal folder As String)
Dim sExplorerEXE As String = String.Format("{0}\explorer.exe",
Environment.GetEnvironmentVariable("windir"))
Dim info As New ProcessStartInfo(sExplorerEXE)
info.Arguments = "/n," + folder
Process.Start(info)
End Sub

End Class


see Command-Line Switches for Windows Explorer:
http://support.microsoft.com/kb/q130510/

Hope this helps,

Shariq Khan
shariq@shariqkhan.com




"Mark" <field027@idonotlikejunkmail.umn.edu> wrote in message
news:%23Xkon7K$EHA.2700@TK2MSFTNGP14.phx.gbl...[color=blue]
> I'd like to open up Windows Explorer from my .NET desktop application to a
> specific path. I essentially want to execute:
>
> %Systemroot%\explorer.exe c:\somepath\
>
> How can this be done? Thanks in advance.
>
> Mark
>
>[/color]


pmclinn
Guest
 
Posts: n/a
#3: Nov 21 '05

re: Open windows explorer from .NET desktop app


System.Diagnostics.Process.Start("explorer.exe", "C:\somepath")

Nak
Guest
 
Posts: n/a
#4: Nov 21 '05

re: Open windows explorer from .NET desktop app


System.Diagnostics.Process.Start("c:\somepath")


Closed Thread