How do I rename C:\Windows\System32\convert.exe?

-2

I need to rename this command because it interferes with ImageMagick. I tried to run this in an administrator console:

C:\Users\Chloe>rename C:\Windows\System32\convert.exe C:\Windows\System32\convertNTFS.exe
The syntax of the command is incorrect.

C:\Users\Chloe>rename C:\Windows\System32\convert.exe convertNTFS.exe
Access is denied.

I also tried to rename it in Explorer. Nothing works!

Chloe

Posted 2017-05-11T01:45:41.357

Reputation: 4 502

Take owner of the file, right click on the executable, and rename it. Why don't you just put the ImageMagick path before Windows/System32 in the path variable – Ramhound – 2017-05-11T01:50:51.820

That doesn't work. Now it says "You need permission from xps\Chloe...". The package is installed with chocolatey and is in chocolatey\bin.

– Chloe – 2017-05-11T01:55:56.233

Now I can't change the owner back to TrustedInstaller. That user/name/account doesn't exist. – Chloe – 2017-05-11T02:03:25.917

I assumed you understood the risks of changing the owner, and your desire, to accomplish what you wanted was defiant? You will have to reset the ACL on the file – Ramhound – 2017-05-11T02:26:31.567

How do you reset ACL? – Chloe – 2017-05-11T06:45:54.707

Answers

5

It is usually not a good idea to rename system files (or change their NTFS permissions, after the next OS-Update this may be reversed back). Ideally contact your Software vendor (for ImageMagick) to request that they don't name their files with the same name as Windows system files.

A workaround hack, is to tell Windows to execute a different program when you are running convert.exe

Run something like this:

reg.exe add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\convert.exe" /v Debugger /t REG_SZ /d "C:\Program Files\ImageMagic\convert.exe" /f

I haven't tested this and I am not sure whether it works if the target has the same name as the source, but it is worth a try.

And you better remember you've done this if you even want to use to convert.exe to convert your file systems.

Another option is to put the ImageMagic folder into the path before %systemroot%.

I would really try to fix the application rather than changing system files.

Peter Hahndorf

Posted 2017-05-11T01:45:41.357

Reputation: 10 677

an sfc /scannow will also revert any change system files – phuclv – 2017-05-11T03:31:52.607

@LưuVĩnhPhúc That command gives the error Windows Resource Protection could not start the repair service. – Chloe – 2017-05-11T07:00:09.290

@Chloe http://www.thewindowsclub.com/windows-resource-protection-could-not-start-the-repair-service anyway as Peter said, changing any system file is risky because it can be reverted at any time

– phuclv – 2017-05-11T07:28:20.647

cd into the ImageMagick folder and run convert also works, or just provide the full path to the exe in the command line. But the easiest way is putting the path befor %systemroot% – phuclv – 2017-05-11T07:32:10.987

@LưuVĩnhPhúc I suggested that solution but it was ignored – Ramhound – 2017-05-13T03:16:23.353

another solution is to rename ImageMagick's convert.exe – phuclv – 2017-06-14T16:28:30.337

1

To rename a file through Command Prompt, you can use the RENAME or REN command.

For example:

rename convert.exe new-convert.exe

However, before making this change, please copy a version of it to protect it in case something wrong.

copy convert.exe convert-copy.exe

Besides, if you have changed the ownership of convert.exe and now want to switch back to TrustedInstaller, then I would recommend searching for NT SERVICE\TrustedInstaller instead of TrustedInstaller

Take a look at this guide

AlizeCamp

Posted 2017-05-11T01:45:41.357

Reputation: 41

The first part was useless because I already said I tried that, but the second part worked, so -1 + 1. – Chloe – 2017-05-11T07:02:32.743

Well! Glad that it helped you. I don't care much about the point. Just want to help :) – AlizeCamp – 2017-05-11T09:17:37.810