Short answer
doskey /reinstall
This destroys the full story.
The second method could also start a new instance of cmd.exe in your batch, this will delete the history made by your set/p statements.
@echo off if "%~1"==":historySafe" goto :historySafe cmd /c "%~f0" :historySafe exit /b :historySafe set /p var=Password echo %var% exit /b
source share