//Optimizar //Liberar Ram private void Button5_Click(object sender, EventArgs e) { Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", Arguments = @"/C cd C:\Program Files\Game_Booster\Archivos & EmptyStandbyList.exe workingsets & EmptyStandbyList.exe modifiedpagelist & EmptyStandbyList.exe priority0standbylist & EmptyStandbyList.exe standbylist" }; process.StartInfo = startInfo; process.Start(); //se localiza el formulario buscandolo entre los forms abiertos Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is Messagebox); if (frm != null) { //si la instancia existe la pongo en primer plano frm.BringToFront(); return; } //sino existe la instancia se crea una nueva frm = new Messagebox(); frm.Show(); }
//Refrescar conexiones de red private void Button9_Click(object sender, EventArgs e) { Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", Arguments = @"/C ipconfig /release & ipconfig /renew & ipconfig /flushdns & netsh winsock reset & exit" }; process.StartInfo = startInfo; process.Start(); Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is Messagebox); if (frm != null) { frm.BringToFront(); return; } frm = new Messagebox(); frm.Show(); }
//Limpiar cache de actualizaciones private void Button11_Click(object sender, EventArgs e) { Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", Arguments = @"/C rd C:\Windows\SoftwareDistribution\Download / s / q & md C:\Windows\SoftwareDistribution\Download & md C:\Windows\SoftwareDistribution\Download & exit" }; process.StartInfo = startInfo; process.Start(); Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is Messagebox); if (frm != null) { frm.BringToFront(); return; } frm = new Messagebox(); frm.Show();; }
//Limpiar archivos temporales private void Button3_Click(object sender, EventArgs e) { Process process = new Process(); ProcessStartInfo startInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "cmd.exe", Arguments = @"/C RD /S /Q %temp% & md %temp% & md %temp% & rd C:\windows\TEMP /s /q & md C:\windows\TEMP & md C:\windows\TEMP & exit" }; process.StartInfo = startInfo; process.Start(); Form frm = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is Messagebox); if (frm != null) { frm.BringToFront(); return; } frm = new Messagebox(); frm.Show();; }