I Don't Know What Is Wrong With My Batch File -
help! making batch file can create list of people. when arrives can type in name , check if they're on list. when batch file checks if person on list not work(i using no capital letters , spelling right) need figure out wrong batch file not working. main problem when checks person on list not find it. sorry, im not sure how phrase this. :) here code program.
@echo off title event starter echo event starter set /p eventname=event name: cls goto :participants :participants title name of participants set /p name1=name: cls set /p name2=name: cls set /p name3=name: cls set /p name4=name: cls set /p name5=name: cls set /p name6=name: cls set /p name7=name: cls set /p name8=name: cls pause goto :checker :checker title come in person's name echo come in arrived check database echo. echo. echo. set /p check1= goto :database :database title checking database given person echo checking database given person cls echo 5 % ping 1.1.1.1 -n 1 -w 5000 > nul cls echo 20 % ping 1.1.1.1 -n 1 -w 5000 > nul cls echo 35 % ping 1.1.1.1 -n 1 -w 5000 > nul cls echo 50 % ping 1.1.1.1 -n 1 -w 5000 > nul cls echo 70 % ping 1.1.1.1 -n 1 -w 5000 > nul cls echo 85 % ping 1.1.1.1 -n 1 -w 5000 > nul cls echo 100 % ping 1.1.1.1 -n 1 -w 5000 > nul if %check1%==%name1% goto :valid if %check1%==%name2% goto :valid if %check1%==%name3% goto :valid if %check1%==%name4% goto :valid if %check1%==%name5% goto :valid if %check1%==%name6% goto :valid if %check1%==%name7% goto :valid if %check1%==%name8% goto :valid goto :invalid :valid title %check% on list! echo %check% on list! ping 1.1.1.1 -n 1 -w 5000 > nul ping 1.1.1.1 -n 1 -w 5000 > nul pause goto :checker :invalid title %check% not on list! echo %check% not on list! echo case-sensative ping 1.1.1.1 -n 1 -w 5000 > nul ping 1.1.1.1 -n 1 -w 5000 > nul goto :checker
to honest, there lot of unnecessary lines there, instead of pinpointing error have rewritten script much cleaner version, should solve problems having well! :)
@echo off title event starter setlocal enabledelayedexpansion echo event starter set /p eventname=event name: cls title name of participants /l %%a in (1,1,8) ( set /p name[%%a]=name: cls ) :checker title come in person's name echo come in arrived check database echo. echo. echo. set /p check1= title checking database given person echo checking database given person cls %%b in (5,20,35,50,70,85,100) ( echo %percent%% ping 1.1.1.1 -n 6 > nul cls ) /l %%a in (1,1,8) ( if !check1!==!name[%%a]! goto :valid ) goto :invalid :valid title %check% on list! echo %check% on list! ping 1.1.1.1 -n 1 -w 10000 > nul goto :checker :invalid title %check% not on list! echo %check% not on list! echo case-sensative ping 1.1.1.1 -n 1 -w 10000 > nul goto :checker
batch-file
No comments:
Post a Comment