|Programs rely upon the operating system to load them, so there has to be some co-operation; it's not something that you can just build in to a program. It all depends upon how the file gets on the PC in the first place, and how the PC is configured. Normally execution of a program is something that the user should be aware of, and should allow. The exception, of course, is malware - in that case you want to execute without the user's permission.|
Which rather begs the question - Why do you want your file to autoexecute?