As I was trying to solve the same problem, it was finally resolved by doing the following:
1. from the control panel, Hardware and Sound page, open the Realtek HD Audio Manager].
2. To the right of the page, click on the Analog folder (Connector settings) icon.
3. check the box to enable a pop up box when a device is plugged in and click "OK"
4. plug in your earphones and when the box pops up, click on headphones (vs. lline out)
5. Voila, the device then mutes the external speaker!
6. You're welcome! The other options didn't work for me either!