Reputation: 11
I'm attempting to launch slui.exe for users not on our network so they can validate their Windows installations via our MAK key with a c# program, but the process will just exit immediately when compiled to an .exe; If I run the program in debug mode from VS 2010 it will run successfully, or if I launch the .exe on a machine with VS2010 installed it will also run successfully. My code looks like:
string path = Environment.SystemDirectory;
ProcessStartInfo startInfo = new ProcessStartInfo(path + "\\slui.exe");
startInfo.Arguments = 4;
Process p = new Process();
p.StartInfo = startInfo;
p.Start();
p.WaitForExit();
I've tried running process explorer and it doesn't show any processes beginning when I attempt to run this code.
Could there be something with .net?? I'm running .net 4 on both machines, so I didn't think that was the problem.
I'm really confused why this code will work fine on my development machine either in debug mode or compiled to an .exe, but not on other machines; I must be missing a dependency somewhere.
Any help would be greatly appreciated!
Upvotes: 0
Views: 1807
Reputation: 4795
Check the EventLog please, if the process crashes on startup it will be listed there. A good example of your symptoms is if you try to start a process whose dependencies are not present for e.g. (I.e. slui.exe references slui.dll and it can't find it).
Upvotes: 1