4. Given that $n$ is a positive integer, denote $1 \times 2 \times \cdots \times n=n!$ (for example, $1!=1,4!=1 \times 2 \times 3 \times 4=24$). If $M$ $=1!\times 2!\times \cdots \times 9!$, then the number of divisors of $M$ that are perfect squares is $(\quad)$.
(A) 504
(B) 672
(C) 864
(D) 936
4. B.

Notice
$$
\begin{array}{l}
M=1! \times 2! \times \cdots \times 9! \\
=2^{8} \times 3^{7} \times 4^{6} \times 5^{5} \times 6^{4} \times 7^{3} \times 8^{2} \times 9 \\
=2^{30} \times 3^{13} \times 5^{5} \times 7^{3} .
\end{array}
$$

Since a perfect square number $n$ has the form
$$
n=2^{2 x} \times 3^{2 y} \times 5^{2 z} \times 7^{2 w}(x, y, z, w \in \mathbf{N}) \text {, }
$$

and $2 x \leqslant 30, 2 y \leqslant 13, 2 z \leqslant 5, 2 w \leqslant 3$,
therefore, such $n$ has a total of
$$
16 \times 7 \times 3 \times 2=672 \text { (numbers). }
$$