No
Infrared (IR) Spectroscopy is a set of techniques that involves the analysis of the interaction between infrared light and a molecule. Infrared spectroscopy is mainly used to determine functional groups in molecules and it can also be employed to study and identify chemicals.
IR spectroscopy cannot be used to distinguish 2-pentanone from 2-hexanone because the two structures have the same functional group. IR spectroscopy can only be used to distinguish molecules that have different functional groups.