The dynamics of strange particles produced in proton-induced nuclear reactions near threshold energies has been investigated within the Lanzhou quantum molecular dynamics transport model. The in-medium modifications on particle production in dense nuclear matter are considered through corrections on the elementary cross sections via the effective mass and the mean-field potentials. It is found that the attractive antikaon-nucleon potential enhances the subthreshold $\overline{K}$ production and influences the structure of inclusive spectra. The strangeness production is strongly suppressed in proton-induced reactions in comparison to heavy-ion collisions. The kaon-nucleon and antikaon-nucleon potentials change the structures of rapidity and transverse momentum distributions and the inclusive spectra. The measured ${K}^{\ensuremath{-}}/{K}^{+}$ ratios in collisions of ${}^{12}\mathrm{C}+{}^{12}\mathrm{C},\phantom{\rule{0.28em}{0ex}}{}^{197}\mathrm{Au}+{}^{197}\mathrm{Au},\phantom{\rule{0.28em}{0ex}}p+{}^{12}\mathrm{C}$, and $p+{}^{197}\mathrm{Au}$ from the KaoS Collaboration have been well explained with the inclusion of the in-medium potentials.