Cannot launch Window Explorer (StartWindowsApplication)

Class library usage, coding and language questions.
Posts: 4
Joined: Tue Aug 19, 2008 12:42 pm

Cannot launch Window Explorer (StartWindowsApplication)

Post by andylee » Thu Aug 28, 2008 3:48 pm

Hi there,

I've tried launching Window Explorer (Windows XP SP2)

Ranorex.Application.StartWindowsApplication("C:\\WINDOWS\\explorer.exe", "C:\\", 5000);

but I'm constantly getting a System.InvalidOperationException (see debug).


2008-08-28 16:42:30.137 [ERROR] [default]: FAIL: auth6
2008-08-28 16:43:11.058 [ERROR] [default]: System.InvalidOperationException: Process has exited, so the requested information is not available.
at System.Diagnostics.Process.EnsureState(State state)
at System.Diagnostics.Process.get_ProcessName()
at Ranorex.Application.GetMainWindowFromProcess(Process proc, Int32 timeout)
at Ranorex.Application.StartWindowsApplication(String fileName, String arguments, Int32 timeout)

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 3:30 pm
Location: Houston, Texas, USA

Post by Support Team » Fri Aug 29, 2008 8:01 am

The problem with Windows Explorer is that be default there may only be a single explorer.exe process. So, if you try to start another explorer.exe process using the Ranorex.Application.StartWindowsApplication method, the newly started explorer process will inform the singleton explorer process to spawn a new window and will then immediatly exit.

You can change this behavior by changing the windows registry:

Ranorex Support Team