It is not entirely clear what it is you're modifying.
or some other hosts.txt file
HOSTS file has no extension.
That said, if I think what you want is the HOSTS file, then you can't do it. It is meant for IPs, not .exe and other files. For those a firewall of some sort is normally used.
Here is a reference to the HOSTS file I'm talking about.http://www.bleepingcomputer.com/forums/t/123980/mvps-hosts-file-update/