To enable invincibility, use a text editor (such as WordPad) to edit the "wingcmdr.cfg" and "wc2.cfg" files for Wing Commander 1 and Wing Commander 2. Just add "-k -b" to both files and you should be impervious to damage. I suggest making a copy of each file before doing this just in case you screw something up, though this is very unlikely.
Why do you want to be invincible by the way? It's much more fun and satisfying to complete the games normally.