Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iandiv committed Jun 26, 2023
1 parent bedb45b commit df1bcac
Show file tree
Hide file tree
Showing 5 changed files with 525 additions and 311 deletions.
32 changes: 14 additions & 18 deletions Win11Tweaker/DialogForm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using System.Management.Automation;
using System.Diagnostics;
using System.Windows.Forms;
using WinBlur;

Expand All @@ -26,29 +26,25 @@ private void negativeBtn_Click(object sender, EventArgs e)

private void positiveBtn_Click(object sender, EventArgs e)
{
using (PowerShell ps = PowerShell.Create())
{

switch (Properties.Settings.Default.val)
{
case 0:
ps.AddScript(@"
Stop-Process -name explorer
");
break;
case 1:
ps.AddScript(@"
Shutdown -l
");
break;
}
case 0:
Process[] explorerProcesses = Process.GetProcessesByName("explorer");
foreach (Process process in explorerProcesses)
{
process.Kill();
}
break;
case 1:
Process.Start("shutdown", "-l");
break;
}



var output = ps.Invoke();
this.Close();
}

}
}
}
Loading

0 comments on commit df1bcac

Please sign in to comment.