5. Place five different files $A, B, C, D, E$ into a row of seven drawers numbered $1, 2, 3, 4, 5, 6, 7$, with each drawer containing at most one file. If files $A$ and $B$ must be placed in adjacent drawers, and files $C$ and $D$ must also be placed in adjacent drawers, then the number of different ways to place the files into the drawers that satisfy the conditions is ( ) ways.
(A) 60
(B) 120
(C) 240
(D) 480
5.C.

Place files $A$ and $B$ in adjacent drawers, denoted as “$AB$”, place files $C$ and $D$ in adjacent drawers, denoted as “$CD$”, and place file $E$ in a drawer, denoted as “$E$”. Thus, “$AB$”, “$CD$”, “$E$”, and the two empty drawers can be considered as five elements, and the number of all permutations of these five elements is $\mathrm{A}_{5}^{5}$. Since the permutations of files $A$ and $B$ and files $C$ and $D$ are both $\mathrm{A}_{2}^{2}$, and the two empty drawers are identical elements, the total number of different methods that satisfy the conditions is $\frac{A_{5}^{5} \cdot \mathrm{A}_{2}^{2} \cdot \mathrm{A}_{2}^{2}}{2}=240$.