Is it possible to disable command history within a batch file?
After calling a my.bat, the results from calls to things like SET /P are pushed in to the history. So if I ask my user to enter a machine name, the history now also contains that machine name.
P:>my.bat
P:>SET /P MYENV=”myenv prompt:”
myenv prompt:lskdjf
P:>lskdjf
P:>
DOSKEY does not seem to have a way to suspend or disable pushing in to the history stack.
Short answer
This erases the complete history.
A second way could also to start a new cmd.exe instance in your batch, this would only remove the history made by your
set/pstatements.