I'm designing a program in Windows Forms C # and I have the following problem:
The program has a button that when clicked, it executes a .bat
that is in a location of the pc.
I've tried running .exe
in this way and it's perfect
but in the case of the .bat
, when you click on the button the console window of .bat
comes out and it quickly closes
the .bat
independently works fine, executing it with double click.
Button code:
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(@"E:\programas pcs\PROGRAMAS\instaladorx64.bat");
}
.bat lines *
@echo off
color 1f
Title Instalandor nombre
echo
echo
echo --------------------------------- ------------------------------------------
echo.
echo Instalando NETFRAMEWORK
echo.
dotnetfx45_full_x86_x64 /passive /norestart
echo.
echo.
cls
echo --------------------------------- -------------------------------------------
echo.
echo Instalando KM-Spico
echo.
sc stop WinDefend
Activador\Activador\KMSpico_setup.exe /SILENT
echo.
echo.
cls