I am trying to find a way to set the security permissions on a file, in the
same way as you would do when you right click a file and view the
permissions tab.

I want to be able to grant the group Everyone permission to a file at
certain times, but at other times restrict access to the Administrators
group.

I am able to do this for my MessageQueue using SetPermissions, but I have so
far been unable to find the equivalent function for files (or directories).