REG DELETE command is not working on 64 bit OS

0

I'm using command below to delete a simple registry key which is not protected, I mean you can easily delete it using regedit GUI, so the permission is free and unlocked.

reg delete TargetKEY /f

This command will work fine in 32 bit system, but on 64 bit OS it gives me "access is denied" as long as there is no limitation with target key's permission rules.

Where is the problem?

Nofuzy

Posted 2014-10-26T17:09:32.357

Reputation: 243

1Are you running this command as an administrator? – Haplo – 2014-10-26T19:01:48.393

As long as I am the ADMINISTRATOR so it should run as an administrator ;) – Nofuzy – 2014-10-26T19:09:39.523

1Nope, even if you are administrator you still have to run it as administrator :) I mean even if you are using local administrator account, STILL, you have to do that to elevate that process. Try it yourself and see if there's a difference. – Haplo – 2014-10-26T19:56:04.833

There is a Bat file contains this command and it is going to be launched by another application, So I have no choice to do it by my own hands :( The strange part is that it is working fine on x86 OS and this error is shown only on x64 OS... – Nofuzy – 2014-10-26T20:06:21.620

Answers

1

I guess you are not running the command as an administrator in 64 BIT OS. Look at this:

enter image description here

This is the result:

enter image description here

This command ran within the local administrator account. Now look at this:

enter image description here

And here is the result:

enter image description here

See the difference?

So, from the comments, if this command running within another batch file, you should run that batch file as an administrator since it will pass authorization to this command. Also you can try disabling UAC.

Haplo

Posted 2014-10-26T17:09:32.357

Reputation: 436

Yes It seems It is working if I run it as administrator, But the problem is that I should do it with my hands! The command is running by an application so is there any extra command to add before reg delete to force it running as administrator? – Nofuzy – 2014-10-27T06:33:27.763

1you can use runas. for example: runas /u:username password "reg delete bla bla /f" – Haplo – 2014-10-27T21:19:04.270