Raphire / Win11Debloat

A simple, easy to use PowerShell script to remove pre-installed apps from Windows, disable telemetry, remove Bing from Windows search as well as perform various other changes to declutter and improve your Windows experience. This script works for both Windows 10 and Windows 11.
MIT License
12.88k stars 546 forks source link

Explorer.exe not reopening #67

Closed Gitzillas closed 4 months ago

Gitzillas commented 4 months ago

Hello,

New to github but I just wanted to post that when I run your script with the parameters -Silent -RemoveApps -RemoveGamingApps -DisableWidgets, Explorer .exe is terminated but then never reopens. I have to manually go in and reopen it through task manager. Are you seeing the same issue on your end?

This is on Windows 11 build 22631.3672

Thanks!

Raphire commented 4 months ago

Heya,

I have run into this in the past, but I wasn't able to figure it out until now. It seems like restarting explorer.exe only works properly if the powershell process and OS architecture match (ie. powershell is run as a 64 bit process on a 64 bit OS).

Do you remember if this was also the case when you ran into this issue?

Gitzillas commented 4 months ago

Thanks so much for getting back to me so quickly!

Yes, it is a 64bit process running on a 64bit OS. I re-ran it just to be sure and I get the explorer.exe crash with no reinitialization again.

Raphire commented 4 months ago

Hmm that's interesting. Do you run any antivirus other than Windows Defender?

Also, could you be so kind to try it again for me with the latest version of the script? I have added a check that prevents the issue I discussed. It shouldn't do anything if the process and OS match, but I just want to confirm if Windows isn't up to any funny business 🙃

Gitzillas commented 4 months ago

Yes, we run Crowdstrike. I could try running it before I install crowdstrike to see if that resolves it.

I pulled the latest version of the script and had the same thing happen. I'll run it before crowdstrike is installed and see if that makes a difference then get back to you. Thanks again!

Raphire commented 4 months ago

Thanks!

I have found a different way to restart the explorer process that may work better. Could you try running this for me in powershell: Stop-Process -processName: Explorer

Explorer should automatically be restarted in this case, the current method the script uses relies on manually stopping explorere with taskkill /f /im explorer.exe and restarting it with Start-Process explorer.exe.

Gitzillas commented 4 months ago

Stop-Process -processName: Explorer asked me to confirm but then it restarted explorer without issue. Not sure if the confirm will be an issue in your script or not.

Raphire commented 4 months ago

That's great! It looks like we can force our way past the confirmation 😄

I'll update the script to use this method.

P.S. I really appreciate the quick response and help with figuring out this issue!

Gitzillas commented 4 months ago

Just pulled the newest version and ran again, explorer restarted perfectly! Thanks so much for your help!

Raphire commented 4 months ago

That's great to hear! Thank you for your help aswell!

Closing issue