I just started using C# again and I encountered a bug/issue while trying to start a process using command prompt.
I am trying to start/open the default On-Screen Keyboard from windows using command prompt. However, after the osk.exe executed, The command prompt window is still open. After manually closing the command prompt window by clicking "x" button and tried to click the button to execute the code again, The command prompt will then close after opening osk.exe as it should be.
Here is the code I tried to run:
Process.Start(Path.Combine(Directory.GetParent(Environment.GetFolderPath(Environment.SpecialFolder.System)).FullName, "Sysnative", "cmd.exe", "/c osk.exe ; exit");
I got this code from this website
I even tried to run another line just to kill all open command prompt with code below. But after executing, another command prompt is opened and never automatically closed....
System.Diagnostics.Process.Start("CMD.exe", "taskkill /IM cmd.exe");
I tried to manually run in command prompt just to see if my windows command prompt has bugs, but its working fine.
I just want to open on-screen keyboard when a button is clicked without keeping an open command prompt and without changing the platform type of my application (i tried to do this before and it messed up most of my OLEDB Connections).
Any answers and suggestions is highly appreciated. Also, I'm very sorry for my bad English.