avrdude: ser_open(): can't set com-state for "\\.\COM1" An error occurred while

My Arduino IDE always shows to me that error when I upload any code :

"avrdude: ser_open(): can't set com-state for "\.\COM1"
An error occurred while uploading the sketch "

I have tried many things but nothing has changed
I tried to upload the code from another computer but it also give me that error so I think that the problem is in the board itself

Make sure you have selected the port of your Arduino board from the Tools > Port menu. COM1 is often the built-in serial port of your computer, NOT the Arduino board.

Sometimes the port will be labeled with the board name in the menu. Other times it will not. If you don’t know which port is your Arduino board, you can find it like this:

  • Unplug your Arduino board from the computer.
  • Tools > Port
  • Note the ports, if any, listed in the menu.
  • Close the Tools menu. The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  • Plug your Arduino board into the computer.
  • Tools > Port - The new port listed in the menu is your Arduino board.