For an n-vertex graph G, the walk matrix of G, denoted by W(G), is the matrix \([e,A(G)e,\ldots ,(A(G))^{n-1}e]\) , where A(G) is the adjacency matrix of G and e is the all-ones vector. For two integers m and \(\ell \) with \(1\le \ell \le (m+1)/2\) , let \(G\circ P_m^{(\ell )}\) be the rooted product of G and the path \(P_m\) taking the \(\ell \) -th vertex of \(P_m\) as the root, i.e., \(G\circ P_m^{(\ell )}\) is a graph obtained from G and n copies of the path \(P_m\) by identifying the i-th vertex of G with the \(\ell \) -th vertex (the root vertex) of the i-th copy of \(P_m\) for each i. We prove that \(\begin{aligned} \det W(G\circ P_m^{(\ell )}) = {\left\{ \begin{array}{ll} \pm (\det A(G))^{\lfloor \frac{m}{2}\rfloor }(\det W(G))^m, & \text {if }\gcd (\ell ,m+1)=1, \\ 0,& \text {otherwise.} \end{array}\right. } \end{aligned}\) This extends a recent result established in [Wang et al. Linear Multilinear Algebra 72 (2024): 828–840], which corresponds to the special case \(\ell =1\) . As a direct application, we prove that if G satisfies \(\det A(G)=\pm 1\) and \(\det W(G)=\pm 2^{\lfloor n/2\rfloor }\) , then for any sequence of integer pairs \(\{(m_i,\ell _i)\}\) with \(\gcd (\ell _i,m_i+1)=1\) for each i, all the graphs in the family \(\begin{aligned} G\circ P_{m_1}^{(\ell _1)}, (G\circ P_{m_1}^{(\ell _1)})\circ P_{m_2}^{(\ell _2)}, ((G\circ P_{m_1}^{(\ell _1)})\circ P_{m_2}^{(\ell _2)})\circ P_{m_3}^{(\ell _3)},\ldots \end{aligned}\) are determined by their generalized spectrum.