Page 1 of 1
Batch Script Help clearing history NOT issue with cls
Posted: 12 Jan 2015 22:30
by gbattis
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.
Re: Batch Script Help clearing history NOT issue with cls
Posted: 12 Jan 2015 22:52
by Squashman
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
Posted: 12 Jan 2015 22:55
by gbattis
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
Posted: 12 Jan 2015 23:00
by Squashman
So use another SET command to clear the variables.
Re: Batch Script Help clearing history NOT issue with cls
Posted: 12 Jan 2015 23:03
by gbattis
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
Posted: 12 Jan 2015 23:07
by Squashman
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
Posted: 12 Jan 2015 23:14
by gbattis
This does not fix the problem.
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
Posted: 12 Jan 2015 23:19
by Squashman
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.
Re: Batch Script Help clearing history NOT issue with cls
Posted: 12 Jan 2015 23:26
by gbattis
yes that is exactly what i couldn't find. thanks very much.