Can't set com-state for COM3

Well this is weird. Was working away uploading fine when I suddenly started getting following the compiler error

avrdude: ser_open(): can't set com-state for "\.\COM3"

Was working fine. Couldn't fix it so un-istalled and re-installed the IDE. Fixed it for a while then started up again with the same error. Oddly enough, if I print something, the port will come back for an upload or two.

No clue what's going on here. Haven't made any changes to the computer. Runing Windows 8 and 1.6.1 of the IDE. The COM3 port shows up and Device Manager says it's working (which makes sense since I can print from the same UBS output if I plug into it).

Any ideas?

It's intermittent. Tried a dozen times, posted here and tried again only to have it work. This is the first time seeing this issue. There are some things about it on the web but nothing definitive.

I did install a new monitor today but its HDMI. Could that be related here somehow?

Please check below point.

In device manager your port being detected or not.If detected no issue.

Then check is there any connection given to Tx & Rx lines ; if yes remove it & upload your code

Check u choosen right board & right port.

Still error persist ; Ur boot loader is freezes so upload bootloader again

AMPS-N:
Then check is there any connection given to Tx & Rx lines ; if yes remove it & upload your code

Sorry, I don't understand this. How do I check the connection to the Tx and Rx lines? What am I looking for?

Have you connected anything to pin Tx & Rx line . Dont connect anything to pin 1 & pin 0

Oh, of course (duh). No there isn't anything connected. The fact that it's intermittent was making me suspect the cable or USB port on the computer. I hadn't considered a compromised boot loader. Thanks for the tips.

I just removed the power supply (ac-dc adapter) and leave the USB connected. It worked afterward.
So I am not sure what happened. May be it stucked.