Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application using an ocx file, after executing the application, when I did right click on the ocx file, I found two new attributes( Everyone and Anonymous ) is added in the properties of ocx file that prevent ocx file from deleting( properties -> security -> Group or username )
How can I remove these attributes programatically in order to delete the ocx file or is there any way to prevent creating these attributes during the executing application?
Posted

1 solution

The attributes are inherited from the folder in which the .ocx is stored. If it is a secured folder such as windows/system32/ then the files in that folder will have the same security attributes applied.

This means to remove the file the application needs to be executed by an account or group with the necessary rights to remove the .ocx.

The .ocx cannot be removed if it is in use.

[Update]
You may need to unregister the ocx first. MSDN link:
http://support.microsoft.com/kb/173091[^
 
Share this answer
 
v2
Comments
Minoo Khazeni 9-Jul-11 0:50am    
It is not in a secured folder
after I remove Everyone and Anonymous group from it's attribute, I can delete the file.
I just wanna know how can I remove these attributes programatically.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900