How to flash bootloader to ATMEGA328P-PN

After looking online for a while I can't seem to find anything on the hardware/software differences. I can't flash the bootloader onto the P-PN. I get the following Error:

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Uno"

avrdude: ser_open(): can't set com-state for "\\.\COM4"
Error while burning bootloader.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

We need more details on exactly how you're attempting to flash the bootloader. Which ISP programmer are you using?