Skip input file/go to beginning of script

August 19, 2009 at 04:51:00
Specs: Windows 7
Hello, I have a script that user can type in something, and it shows up on the scree, as a log.
But If I want them to not write anything in, and keep the log clean (go to the beginning of the script) how do I do it?
Or just skip the chat part to update the script?
Please help!
Or do I have to have separate write and display scripts?
v HERE IS THE SCRIPT v


@ echo off

echo. > 0.txt
echo. > 1.txt
echo. > 2.txt
echo. > 3.txt
echo. > 4.txt
echo. > 5.txt
echo. > 6.txt
echo. > 7.txt
echo. > 8.txt

echo.
echo Welcome
echo.
set /p n=Your Name:
echo %n% > l.txt
cls
:1

set /p varl= <l.txt
echo %varl%has just logged in
echo -----------------------

echo.
set /p var8= <8.txt
echo %var8%
echo.

set /p var7= <7.txt
echo %var7%
echo.

set /p var6= <6.txt
echo %var6%
echo.

set /p var5= <5.txt
echo %var5%
echo.

set /p var4= <4.txt
echo %var4%
echo.

set /p var3= <3.txt
echo %var3%
echo.

set /p var2= <2.txt
echo %var2%
echo.

set /p var1= <1.txt
echo %var1%
echo.

echo -----------------------
****** RIGHT BELOW THIS ********
set /p c=Message:
echo - %n% says: %C% > 0.txt
echo %date% %time% %n% says: %c%>> history.txt

del 8.txt
ren "7.txt" "8.txt"
ren "6.txt" "7.txt"
ren "5.txt" "6.txt"
ren "4.txt" "5.txt"
ren "3.txt" "4.txt"
ren "2.txt" "3.txt"
ren "1.txt" "2.txt"
ren "0.txt" "1.txt"
set /p var0= <0.txt
echo %var0% >0.txt

cls
goto 1


See More: Skip input file/go to beginning of script

Report •


#1
August 19, 2009 at 06:50:30
Try this:

echo off
echo - > 0.txt
echo - > 1.txt
echo - > 2.txt
echo - > 3.txt
echo - > 4.txt
echo - > 5.txt
echo - > 6.txt
echo - > 7.txt
echo - > 8.txt

:welcome
cls
echo.
echo Welcome
echo.
set /p n=Your Name:
if "%n%"=="" goto :welcome
echo %n% > l.txt
cls

:1
set /p varl= <l.txt
echo %varl%has just logged in
echo -----------------------
echo.

set /p var8= <8.txt
echo %var8%
echo.

set /p var7= <7.txt
echo %var7%
echo.

set /p var6= <6.txt
echo %var6%
echo.

set /p var5= <5.txt
echo %var5%
echo.

set /p var4= <4.txt
echo %var4%
echo.

set /p var3= <3.txt
echo %var3%
echo.

set /p var2= <2.txt
echo %var2%
echo.

set /p var1= <1.txt
echo %var1%
echo.

echo ----------------[ Q + ENTER to Quit ]---
::****** RIGHT BELOW THIS ********
:message
set c=
set /p "c=Message:"
if "%c%"=="" cls & goto 1
if /i "%c%"=="q" goto :eof
echo - %n% says: %C% > 0.txt
echo %date% %time% %n% says: %c%>> history.txt
del 8.txt
ren "7.txt" "8.txt"
ren "6.txt" "7.txt"
ren "5.txt" "6.txt"
ren "4.txt" "5.txt"
ren "3.txt" "4.txt"
ren "2.txt" "3.txt"
ren "1.txt" "2.txt"
ren "0.txt" "1.txt"
set /p var0= <0.txt
echo %var0% >0.txt
cls
goto 1



Report •
Related Solutions


Ask Question