Accessing HKEY_LOCAL_MACHINE Registry For Clearing Volume Caches

(imported topic written by jcp_00791)

I am trying to create a batch file that will use the cleanmgr.exe utility to clear out disk cleanup options. I have made a batch file that works correctly when run localy, but when I run it through a task from Big Fix it will not delete the selected options. I believe this has to do with the local system account not being able to access the Local Machine registry keys for deleting. I can change the client on my machine to logon as myself and it will run correctly.

Any ideas how I can make this run and have rights to delete using the local system account?

Here is a sample of the registry keys I’m trying to access.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Recycle Bin

Thanks

(imported comment written by BenKus)

Hey jcp,

The SYSTEM account shouldn’t have any permissions problems for HKLM, but there might be some other reasons why it might not work well with the SYSTEM account… Maybe try running as the current user?

http://support.bigfix.com/cgi-bin/kbdirect.pl?id=392

Ben