3
I’m using the Process.start()
to open some system applications, however despite working properly for the notepad
and for the calculator, when I try to open the screen keyboard (osk.exe
) the program has an abrupt termination and gives the following error:
"The system cannot find the especified file"
The code I have is this::
private void calculadoraToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("calc.exe");
}
private void blocoDeNotasToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("notepad.exe");
}
private void tecladoNoEcrãToolStripMenuItem_Click(object sender, EventArgs e)
{
Process.Start("osk.exe");
}
Open a Powershell prompt and type
[diagnostics.process]::Start("osk.exe")
. What is the result?– Augusto Vasques
in Powershell works... curious pq inside the C#, even putting
FileInfo file = new FileInfo("C:\\Windows\\System32\\osk.exe");
shows that the file does not exist. It must be a security issue– Rovann Linhalis
@Augustall if I try to run this code in Powershell the application runs, however, in C# this does not have the same effect.
– Duo
From inside the interactive c# prompt(
csi.exe
) I managed to call theosk.exe
. I used the lines:> using System.Diagnostics;
and> Process.Start("osk.exe");
. I will open an instance of Visual Studio.– Augusto Vasques
Here works of good
– Leandro Angelo
@Leandroangelo did it in visual studio or Powershell?
– Duo
@Leandroangelo No visual studio does not work. Error image , conversion of hresult , OS error table
– Augusto Vasques
@Rovannlinhalis, I found the problem.
– Augusto Vasques