I noticed even if you make changes to preferences.txt , sketch still try to refer COM1. Also when you restart sketch editor it defaults the preferences.txt back to COM1. In my case port was COM5 on Win10 PC. I just selected Tools-->Port and after expanding Port menu i see three options COM3, COM4 and COM5(Arduino/Genuino UNO), select the port you need, i selected COM5 and then it was showing as selected under Tools Menu and problem was solved . I restarted Sketch and it was referring to COM5 going forward. Hope this helps.