Can't select correct serial port for Mega 2560

I'm using an Arduino Mega 2560 board and most of the time, I can't select the serial port that uploads the code to the board. The port that works is com9, but com3 is usually the only one listed (and doesn't allow me to upload to the board via this port). The only thing I can do is keep connecting and reconnecting the board until it works, but it usually doesn't. How can this be permanently fixed?