Hey, I have a simple batch file I'm working on right now- basically it's "multiplayer notepad", or a simple way of instant-messaging across a file server. It's set up so that the text refreshes whenever you type a message or type "refresh", but I want it to refresh in 1- or 2-second intervals. How would I do this without causing it to disrupt the user input?
@echo off
set chatname=%COMPUTERNAME%
echo %chatname% has joined.>>chat.txt
:text
cls
echo Enter a message: Type something that isn't
echo a command listed below, then press Enter.
echo Refresh: "refresh"
echo Change your username: "username"
echo Exit the program: "exit" or "end" or "quit"
echo ---
type chat.txt
echo ---
set /p msg=%chatname%:
if %msg%==refresh goto :text
if %msg%==username goto :username
if %msg%==exit goto :end
if %msg%==end goto :end
if %msg%==quit goto :end
echo %chatname%: %msg%>>chat.txt
goto :text
:username
set /p chatname=Set new username:
goto :text
:end
echo %chatname% has exited.>>chat.txt
Also, if it's at all possible, how can I stop the program from crashing whenever certain symbols (including <>'"\) are inputted?