Can I used Spiked Gauntlets (or armor spikes) as an archery ranger for the sole purpose of using a bow normally, but still getting attacks of opportunity on bad guys around me? Even though I'm shooting with my bow, I can randomly swing at them with my gauntlet?
Yes. There are dozens of example threads on this forum where people talk about the pros and cons of doing exactly that, and other related and/or creative similar ideas. A quick search will turn up tons of info on this entire concept.