|I started a new thread because this issue is not related to one I had before.|
I have a program that asks for user to log in, after that it gives user X amount of seconds to give a work ID. If the user hasn't responded the program will go back to login-screen.
I run the program in full-screen (just set all bat-files to be run in full-screen).
Everything else is ok, but when I have either made the first work log or waited for the program to log me out automatically, the program doesn't work as supposed. I DO get into the login-screen but when I try to log in, it fails to do so? Any ideas?
I will paste here what I have come up with, program consist of three files;
- login.bat asks for user id.
- logwork.bat asks for work id.
- wait.bat sets the reply time for user.
set /P ID=Log in (any string of characters):
start %0 logwork.bat
cls & echo %ID%
set /P WORK=Insert work (any string of characters):
taskkill /F /FI "WINDOWTITLE eq waitforit" > NUL
echo marked %ID% %WORK% %COMPUTERNAME% %DATE% %TIME% >> %ID%.log
echo Logging out . . .
FOR /l %%a in (5,-1,1) do (echo %%as&ping -n 2 -w 1 localhost>NUL)
ping -n 1 -w 1 localhost>NUL
ping -n 10 localhost>NUL
taskkill /F /FI "WINDOWTITLE eq logwork"
ping -n 2 localhost>NUL
And please do not laugh at my code, this is only the second "real" program I am writing with batch :) I'm sure there are tons of bugs and glitches and I'm sure it's not even supposed to work...