I found this error on Google several times, but it didn't help me much. I am trying to upload a new program to my recently received Arduino UNO r3, but got this error:
avrdude: ser_open(): can't open device "\\.\COM1": The system cannot find the file specified.
I use the Arduino IDE 1.6.5 on Windows 8.1. I checked the device manager. The port is still com4 as when I uploaded yesterday. Also the IDE tools->port shows the same com4. I tried to change it to com5 via the device manager. The IDE follows, but the avrdude still insists on using COM1. I tried to reset the Arduino using the reset button while reconnecting the USB (which also powers it). But the Arduino resumes running the program from yesterday when I let the reset button go. The device manager still shows com5. But the avrdude still tries to use the COM1 port. What do I not understand ?