Volledige versie bekijken : Einde van .bat wordt niet weergegeven op scherm



Reaper
29 August 2015, 03:05
Waarschijnlijk een kleinigheidje dat ik over het hoofd zie ofzo.
Zoals het nu is slaagt het bestand op zoals ik wil, dus dat is geen probleem.
Het probleem is dat jij de laatste regels niet weergeeft voor het bat bestand afsluit.

Iemand die me kan vertellen waar het foutje zit? (het is het stukje



REM games played
set /P S=Howmany games did you play?
cls


REM Game 1 input
@echo Game 1 input
set /p Game1= Enter Gametype:
set /p BBuse1= Enter amount of bb's used:
set /p Kill1= How many kills did you deal:
set /p Hit1= How many times did you die:
echo off
set /a acc1="(%Kill1% * 100) / %BBuse1%"
if "%S%" EQU "1" goto :Output
cls


REM Game 2 input
@echo Game 2 input
set /p Game2= Enter Gametype:
set /p BBuse2= Enter amount of bb's used:
set /p Kill2= How many kills did you deal:
set /p Hit2= How many times did you die:
echo off
set /a acc2="(%Kill2% * 100) / %BBuse2%"
if "%S%" EQU "2" goto :Output
cls


REM Write Output
:Output
REM Output Game 1
echo Game: %Game1% >> %Output%\%Loc%.txt
echo BB's used: %BBuse1% >> %Output%\%Loc%.txt
echo K/D ratio: %Kill1%/%Hit1% >> %Output%\%Loc%.txt
echo Accuracy: %acc1%%% >> %Output%\%Loc%.txt
echo ________________ >> %Output%\%Loc%.txt
pause
if "%S%" EQU "1" goto :eof


REM Output Game 2
echo Game: %Game2% >> %Output%\%Loc%.txt
echo BB's used: %BBuse2% >> %Output%\%Loc%.txt
echo K/D ratio: %Kill2%/%Hit2% >> %Output%\%Loc%.txt
echo Accuracy: %acc2%%% >> %Output%\%Loc%.txt
echo ________________ >> %Output%\%Loc%.txt
if "%S%" EQU "2" goto :eof




:eof
cls
@echo Thank you for using AIRSOFT STATISTICS GENERATOR V1.4 by Reaper
@echo Your input is saved
pause

Merel
29 August 2015, 15:39
En als de extensie van het bestand.bat wordt vervangen door bestand.cmd ?
Mogelijk idioot, maar wie weet.

Merel
29 August 2015, 15:58
En als de extensie van het bestand.bat wordt vervangen door bestand.cmd ?
Mogelijk idioot, maar wie weet.


Vond de uitleg op het net, dat de @ eigenlijk belet dat de regel wordt getoond.
De meer gecompliceerde uitleg was het Engels

By default, the echo feature is on in MS-DOS-based (and later, Windows) systems when executing a batch file. That means that every command issued in a batch file (and all of its output) would be echoed to the screen. By issuing, the ‘echo off’ command, this feature is turned off but as a result of issuing that command, the command itself will still show up on the screen. By including the ‘@’ symbol in ‘@echo off’, it will prevent the ‘echo off’ command from being seen on the screen.Met andere woorden als men de @ verwijdert zou echo wel werken.

Reaper
29 August 2015, 16:49
goed idee, maar helaas.
met de @'s weg geeft hij het nog steeds niet weer

Reaper
29 August 2015, 16:55
hmmm, net tot een rare ontdekking gekomen.
als ik het .bat script open, en ik geef niets van gegevens in, dan geeft hij wel het einde weer