0

So, I was working on a GUI written in Batch only, for a project at school. now that I coded the GUI, it needs to be replaced with the "explorer.exe" located in "C:\Windows" and NO. I am not talking about "iexplorer.exe". nowhere is my question: How do I delete (I have a backup) the explorer.exe in batch code only? (with admin permissions). just "taskkill /f /im explorer.exe" and "del C:\Windows\explorer.exe /f" dosen't work, because it just returns "Access Denied". anyone a suggestion how to do it?

3
  • Which the Windows version? Check it out with the cmd winver.
    – Jorge Luiz
    May 21, 2020 at 19:12
  • Why does it need to replace Explorer.exe on disk? What are you trying to achieve by doing it? Are you trying to replace the "Shell" as referenced here: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon ? May 21, 2020 at 19:56
  • I'm running Windows 10 Build 1909, and no from a .reg file it dosen`t work, or replacing it using batch only isn't an option
    – FuchsPlayZ
    May 22, 2020 at 6:53

1 Answer 1

3

You must to change ownership and permissions of explore.exe file to do that one succesfull.

Create a file called script.bat somewhere, in that case I created in C:\script.bat with the following content:

echo off
taskkill /f /im explorer.exe
takeown /a /f C:\Windows\explorer.exe
icacls C:\Windows\explorer.exe /grant administrators:f
del C:\Windows\explorer.exe

Run Task Scheduler by cmd taskschd.msc /s

Go to Create Task ...

Enter Name: field with ScriptTask

Left click on Run whether user is logged on or not

Check Do not store password. The Task will only have access to local computer resources.

Check Run with highest privileges

Go to Triggers tab

Left click on New...

Change Begin the task to At startup

Go to Actions tab

Left click on New...

Enter Program/script: field with C:\script.bat

Left click on OK

Left click on OK again

Then, restart your machine by cmd shutdown /t 0 /r

The script will delete the explorer.exe file sucessfully during the system startup.

References:

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .