Opening windows explorer in windows 7

Associate
Joined
27 Jan 2005
Posts
1,408
Location
S. Yorks
Right have an issue with opening windows explorer in windows 7.

Using VBA in excel and the following
Code:
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

Sub Open_ExplorerWindow()

    ShellExecute 0, "open", "c:\temp", 0, 0, 1

End Sub

Windows explorer opens, using task manager we can see in the command line:

C:\Windows\Explorer.exe /factory, {ceff45ee...

Using the following code in vba

Code:
Public Sub w001()
Call Shell("explorer.exe 'c:\Temp")

End Sub

Windows explorer opens, using task manager we can see in the command line:

C:\Windows\Explorer.exe /factory, {75dff2b7...

Now the issue is, in C# it always opens up C:\Windows\Explorer.exe /factory, {75dff2b7... for those that don't know the 75dff2b7 is the multiple instance explorer - I didn't know it just googled it to find it out.

Anyway the problem is we are getting the software intermittently crashing in c# when explorer is opened so we are suspecting there is an issue with explorer 75dff2b7. So can anyone advise me how to open explorer in c# specifying the single instance option?

Oh have tried the "Launch folder windows in a separate process box" option in explorer options but it still opens 75dff2b7.

Matt
 
Back
Top Bottom