I made a program in C#. It copies itself to startup if the user ticks the box to do so.
The application adds itself to startup using the registry key "SOFTWARE\Microsoft\Windows\CurrentVersion\Run".
It works fine, aside from the problem that every time the machine is restarted, the user is prompted whether they're sure they want to run the program because it's blocked by Windows because it "comes from another computer".
Any way I can get rid of this Windows "blocked" flag through the code so that the user isn't prompted everytime the program tries to run itself?
Thanks
1 – Right click on the file that is blocked. 2 – Select Properties from the options that appear. 3 – Click on the General tab in the Properties window. 4 – Click on the Unblock option next to the Security detail which says “This file came from another computer and might be blocked to help protect this computer.”
When downloaded/copied to the machine, Windows attached a Zone Identifier (http://msdn.microsoft.com/en-us/library/dn392609.aspx) based in the location it the file came from (http://msdn.microsoft.com/en-us/library/ms537183.aspx)
In order to unblock the file, you will either have to have the user open up the file properties and click the Unblock button, or remove it yourself.
You can find more information on how this happens and a few ways to do so (including with code) here: http://weblogs.asp.net/dixin/archive/2009/03/14/understanding-the-internet-file-blocking-and-unblocking.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With