Process.Start("d:/test.txt"); //simple .txt file
works perfectly fine on Windows 8 onward but on Windows 7 (x64) it starts the process and immediately closes it.
I've already tried the following:
Calling through
ProcessStartInfo
and settingCreateNoWindow=true
,UseShellExecute=true
andVerb="runas"
(though not sure why I had to set this one).Tried attaching
Exit
event and it confirms that the process does start but it exits right away and I don't even see the Notepad window open for a blink of a second.
Edit: I've tried it with an image files and few other extensions and they open just perfect. Something wrong with just the .txt files (and/or probably other formats).
Process.Start("notepad.exe", "d:/test.txt");
– HaytonProcess.Start("notepad");
work? Can you run Notepad on that machine? I suggest you try creating a new user and try the same code from the new account. – Millardmillboard