L. Vandendriessche
L. Vandendriessche

Reputation: 140

Starting exe with Process.Start(), weird stuff going on

Im currently trying to automate the Microsoft Assessment and Planning Toolkit. But I'm running into a problem.

When I start the toolkit by clicking the icon on my desktop, the toolkit works fine. But, if I execute the exe by using Process.Start(), the toolkit bugs. (After a change of the selection in the left pane, the options are not shown. Next to this, when the toolkit is closed an error is shown)

Started from shortcut on my desktop:

Started from shortcut on my desktop

Started with Process.Start():

Started with Process.Start()

The code for starting the exe:

ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "C:\\Program Files\\Microsoft Assessment and Planning Toolkit\\bin\\MapToolkit.exe";
Process p = Process.Start(start);

Anyone has any idea what this could be, or how I could solve this behaviour?

Upvotes: 3

Views: 95

Answers (1)

Chris Ballard
Chris Ballard

Reputation: 3769

Try using WorkingDirectory:

ProcessStartInfo start = new ProcessStartInfo();
start.FileName = "C:\\Program Files\\Microsoft Assessment and Planning Toolkit\\bin\\MapToolkit.exe";
start.WorkingDirectory = "C:\\Program Files\\Microsoft Assessment and Planning Toolkit\\bin";
Process p = Process.Start(start);

Upvotes: 5

Related Questions