My desktop background keeps turning black, and restarting Explorer brings it back. Can I put a .cmd or .bat file on the desktop to do that with a click?
Can I restart Windows Explorer with a batch file?
Answers
Yes. Open Notepad and put these two commands on separate lines, then save the file as restart-explorer.cmd. Choose All Files in the save dialog so Notepad doesn't add .txt to the name.
taskkill /f /im explorer.exestart "" explorer.exe
Double-click the file to run it. The taskbar and desktop will briefly disappear while Explorer restarts, and any open File Explorer windows may close.
Reply to this answer
I'd also check where the wallpaper file is stored. If it's on a network share or removable drive, try copying it to a local folder in your user profile and setting it again. A Pictures folder can be redirected, so check its actual location too.
Reply to this answer
The batch file is a handy workaround, but a daily black background is worth investigating. Check for Windows updates, and consider running sfc /scannow and DISM's RestoreHealth repair if you suspect damaged system files. Unstable hardware settings are another possibility, not a diagnosis on their own.
Reply to this answer
If Explorer has already stopped and you just need it back, press Windows+R, type explorer.exe and press Enter. That's a quick manual option without opening Task Manager.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Wumple:
Does the first command restart Explorer by itself?
puddleproof_plans:
No, taskkill just stops it. The second command starts it again.