By analyzing $2.93 rm fb^{-1}$ of data taken at a center-of-mass energy of 3.773~GeV with the BESIII detector, we measure the branching fractions of the Cabibbo-favored hadronic decays $D^0to K^-pi^+eta^prime$, $D^0to K^0_Spi^0eta^prime$ and $D^+to K^0_Spi^+eta^prime$, which are determined to be $(6.43 pm 0.15_{rm stat.} pm 0.31_{rm syst.})times 10^{-3}$, $(2.52 pm 0.22_{rm stat.} pm 0.15_{rm syst.})times 10^{-3}$ and $(1.90 pm 0.17_{rm stat.} pm 0.13_{rm syst.})times 10^{-3}$, respectively. The precision of the branching fraction of $D^0to K^-pi^+eta^prime$ is significantly improved, and the processes $D^0to K^0_Spi^0eta^prime$ and $D^+to K^0_Spi^+eta^prime$ are observed for the first time.