Batch Script Help clearing history NOT issue with cls

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
gbattis
Posts: 12
Joined: 12 Jan 2015 11:35
Contact:

Batch Script Help clearing history NOT issue with cls

#1 Post by gbattis » 12 Jan 2015 22:30

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

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Batch Script Help clearing history NOT issue with cls

#2 Post by Squashman » 12 Jan 2015 22:52

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.

gbattis
Posts: 12
Joined: 12 Jan 2015 11:35
Contact:

Re: Batch Script Help clearing history NOT issue with cls

#3 Post by gbattis » 12 Jan 2015 22:55

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.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Batch Script Help clearing history NOT issue with cls

#4 Post by Squashman » 12 Jan 2015 23:00

So use another SET command to clear the variables.

gbattis
Posts: 12
Joined: 12 Jan 2015 11:35
Contact:

Re: Batch Script Help clearing history NOT issue with cls

#5 Post by gbattis » 12 Jan 2015 23:03

example? I don't see how setting a variable will fix this problem. Sorry for my ignorance I am fairly new to batch scripting.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Batch Script Help clearing history NOT issue with cls

#6 Post by Squashman » 12 Jan 2015 23:07

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%

gbattis
Posts: 12
Joined: 12 Jan 2015 11:35
Contact:

Re: Batch Script Help clearing history NOT issue with cls

#7 Post by gbattis » 12 Jan 2015 23:14

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.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Batch Script Help clearing history NOT issue with cls

#8 Post by Squashman » 12 Jan 2015 23:19

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

gbattis
Posts: 12
Joined: 12 Jan 2015 11:35
Contact:

Re: Batch Script Help clearing history NOT issue with cls

#9 Post by gbattis » 12 Jan 2015 23:26

yes that is exactly what i couldn't find. thanks very much.

Post Reply