Batch Script Help clearing history NOT issue with cls
Moderator: DosItHelp
Batch Script Help clearing history NOT issue with cls
I need all previous entry's typed to be cleared. I got this to work to clear the password from the history but I want everything cleared from the input history. I know you can clear using ALT+F7 but I want this done automatically to clear the username entry.
Last edited by Squashman on 12 Jan 2015 23:27, edited 2 times in total.
Reason: MOD EDIT: Removed code as it had no relevance to the question
Reason: MOD EDIT: Removed code as it had no relevance to the question
Re: Batch Script Help clearing history NOT issue with cls
gbattis wrote:My current issue is before the :menub tag.
You do not have a menub label in your code.
Not sure what you really need to do.
If you want to clear the contents of a variable then just use the SET command to clear the contents of the variable.
Re: Batch Script Help clearing history NOT issue with cls
sorry my bad it is not the menub it is :menua tag and i want to clear the history from ALL of the previous set /p functions as it was done with the password around the :password1 tag.
Re: Batch Script Help clearing history NOT issue with cls
So use another SET command to clear the variables.
Re: Batch Script Help clearing history NOT issue with cls
example? I don't see how setting a variable will fix this problem. Sorry for my ignorance I am fairly new to batch scripting.
Re: Batch Script Help clearing history NOT issue with cls
Code: Select all
C:\Users\Squash>set /p password=
12345
C:\Users\Squash>echo %password%
12345
C:\Users\Squash>set password=
C:\Users\Squash>echo %password%
%password%
Re: Batch Script Help clearing history NOT issue with cls
This does not fix the problem.
try this save this as a batch.
After typing something and it returns you can get the previous input by clicking the up arrow to put back the last entry. I need to know how to clear this entry as I was able to do with the password on the other batch file.
try this save this as a batch.
Code: Select all
@echo off
:a
echo type 1+1
set /p sum=
set /a ans=%sum%
echo = %ans%
pause
cls
goto :a
After typing something and it returns you can get the previous input by clicking the up arrow to put back the last entry. I need to know how to clear this entry as I was able to do with the password on the other batch file.
Re: Batch Script Help clearing history NOT issue with cls
gbattis wrote:After typing something and it returns you can get the previous input by clicking the up arrow to put back the last entry. I need to know how to clear this entry as I was able to do with the password on the other batch file.
That should have been in your FIRST post. Try to think about what you need done and explain it a little better.
I google searched for: batch clear command history and the very first link google provided was this.
Code: Select all
doskey /reinstall
Re: Batch Script Help clearing history NOT issue with cls
yes that is exactly what i couldn't find. thanks very much.