The Code Access Security
(Caspol.exe) is a utility
provided with the .NET Framework that allows you
.NET's code-access security system from the command
line and from batch files. You can run Caspol.exe from the following location, where
version is the version of the .NET
framework, such as "v1.0.3705" for
When performing some administrative tasks Caspol.exe commands can become long and confusing, but for many tasks, Caspol.exe provides a much quicker way of configuring and inspecting security policy, as long as you are happy to work from the command line. Before we look at how to configure security policy using Caspol.exe, there is one Caspol.exe configuration setting that you will want to change if you use Caspol.exe frequently.
Whenever you run a Caspol.exe command that changes the security policy configuration, before Capsol.exe commits the change to disk, it will prompt you to confirm the change with the following message:
The operation you are performing will alter security policy. Are you sure you want to perform this operation? (yes/no)
You must enter "y" or "yes" for the change to proceed. Although it serves a valuable purpose, you will find this level of protection frustrating if you use Caspol.exe frequently. To turn this prompt on and off use the following statements, but remember that if you turn it off, any changes you make will be committed ...