If you're using Realtek for your audio, there should be an option to control how the front audio ports respond when there is a device plugged in. (e.g. Whether the speakers are disabled or not) If something else, you'll have to poke around in the options.
You can also try start > control panel > hardware and sound > manage audio devices and adjust the default device by right clicking and selecting 'set as default device' on your speakers / headphones. I can't verify that works as I haven't played around with that while having both speakers and headphones plugged in.