checkex
Goto Top

Batch-Datei überspringt abfrage

Hallo liebe Community (:
Ich bin gerade dabei, eine Batch-Datei zu schreiben, die ich dringend zur Auswertung von "Ankreuz"-Bögen brauche. Dabei bräuchte ich schnelle Hilfe, da nicht alles so funktioniert wie es soll.

Das Problem ist, dass nach der ersten Abfrage einfach die ganzen anderen Abfragen bis zur Text-Abfrage übersprungen werden. Ehrlich gesagt habe ich dazu keine Idee mehr ( am besten runterladen & selbst ansehen).

Vielen Dank im Vorraus für Antworten & Lösungen

Quellcode:
@echo off
cls

echo.
echo Zensiert :D
echo.

pause >nul

:start
cls

set co11=0
set co12=0
set co13=0
set co14=0

set co21=0
set co22=0
set co23=0
set co24=0

set co31=0
set co32=0
set co33=0
set co34=0

set co41=0
set co42=0
set co43=0
set co44=0

set co51=0
set co52=0
set co53=0
set co54=0

set co61=0
set co62=0
set co63=0
set co64=0

set co71=0
set co72=0
set co73=0
set co74=0

set co81=0
set co82=0
set co83=0
set co84=0

set co81=0
set co82=0
set co83=0
set co84=0

set co91=0
set co92=0
set co93=0
set co94=0

set co101=0
set co102=0
set co103=0
set co104=0

:1
cls

echo Frage 1:
echo.
set /p frage1=

if {{comment_strings:62462503908}}=={{comment_strings:23228379407}} set /a co11=%co11%+1 
if {{comment_strings:32423709420}}=={{comment_strings:62256468920}} set /a co12=%co12%+1 
if {{comment_strings:83015929887}}=={{comment_strings:43570184497}} set /a co13=%co13%+1 
if {{comment_strings:31519043411}}=={{comment_strings:8839668685}} set /a co14=%co14%+1 

cls

set /p again=Zusaetzliche Antwort? (j/n)

if {{comment_strings:81421986265}}=={{comment_strings:32118853960}} goto 1 
if {{comment_strings:52186254924}}=={{comment_strings:31938250540}} goto 2 

if {{comment_strings:93773993286}}=={{comment_strings:7179844795}} goto 1 
if {{comment_strings:82198301828}}=={{comment_strings:31497411832}} goto 2 

if {{comment_strings:22737292318}}=={{comment_strings:52827743454}} goto 1 
if {{comment_strings:6959972135}}=={{comment_strings:53824205186}} goto 2 

if {{comment_strings:31831135064}}=={{comment_strings:51199724909}} goto 1 
if {{comment_strings:53698480041}}=={{comment_strings:22334498507}} goto 2 




:2
cls

echo Frage 2:
echo.
echo set /p frage2=

if {{comment_strings:32693512107}}=={{comment_strings:42663566028}} set /a co21=%co21%+1 
if {{comment_strings:71081863420}}=={{comment_strings:31285381084}} set /a co22=%co22%+1 
if {{comment_strings:1883435173}}=={{comment_strings:54159190843}} set /a co23=%co23%+1 
if {{comment_strings:43199320645}}=={{comment_strings:7970513720}} set /a co24=%co24%+1 

:3
cls

echo Frage 3:
echo.
echo set /p frage3=

if {{comment_strings:5517959200}}=={{comment_strings:81109228294}} set /a co31=%co31%+1 
if {{comment_strings:3107626880}}=={{comment_strings:31486213620}} set /a co32=%co32%+1 
if {{comment_strings:21292618310}}=={{comment_strings:2131870873}} set /a co33=%co33%+1 
if {{comment_strings:72885524710}}=={{comment_strings:52510401161}} set /a co34=%co34%+1 

:4
cls

echo Frage 4:
echo.
echo set /p frage4=

if {{comment_strings:91658847576}}=={{comment_strings:81272800852}} set /a co41=%co41%+1 
if {{comment_strings:31192048012}}=={{comment_strings:11994453541}} set /a co42=%co42%+1 
if {{comment_strings:63697480416}}=={{comment_strings:41538838774}} set /a co43=%co43%+1 
if {{comment_strings:11954690842}}=={{comment_strings:43388809225}} set /a co44=%co44%+1 

:5
cls

echo Frage 5:
echo.
echo set /p frage5=

pause

if {{comment_strings:23585008501}}=={{comment_strings:34033060642}} set /a co51=%co51%+1 
if {{comment_strings:43794988541}}=={{comment_strings:32814010567}} set /a co52=%co52%+1 
if {{comment_strings:21613027628}}=={{comment_strings:64204777577}} set /a co53=%co53%+1 
if {{comment_strings:33989735814}}=={{comment_strings:11141601056}} set /a co54=%co54%+1 

:6
cls

echo Frage 6:
echo.
echo set /p frage6=

if {{comment_strings:42186229032}}=={{comment_strings:11074879929}} set /a co61=%co61%+1 
if {{comment_strings:92583472305}}=={{comment_strings:9162174061}} set /a co62=%co62%+1 
if {{comment_strings:21944061250}}=={{comment_strings:22419619161}} set /a co63=%co63%+1 
if {{comment_strings:43031243698}}=={{comment_strings:6276702872}} set /a co64=%co64%+1 

:7
cls

echo Frage 7:
echo.
echo set /p frage7=

if {{comment_strings:53770443566}}=={{comment_strings:7169250713}} set /a co71=%co71%+1 
if {{comment_strings:31642543815}}=={{comment_strings:21595753043}} set /a co72=%co72%+1 
if {{comment_strings:94128670835}}=={{comment_strings:63578165221}} set /a co73=%co73%+1 
if {{comment_strings:7225047233}}=={{comment_strings:9224613341}} set /a co74=%co74%+1 

:8
cls

echo Frage 8:
echo.
echo set /p frage8=

if {{comment_strings:61306353091}}=={{comment_strings:13455584769}} set /a co81=%co81%+1 
if {{comment_strings:9143630799}}=={{comment_strings:71942528941}} set /a co82=%co82%+1 
if {{comment_strings:61342640259}}=={{comment_strings:41892422232}} set /a co83=%co83%+1 
if {{comment_strings:72770586882}}=={{comment_strings:31262995427}} set /a co84=%co84%+1 

:9
cls

echo Frage 9:
echo.
echo set /p frage9=

if {{comment_strings:74171352304}}=={{comment_strings:13887473692}} set /a co91=%co91%+1 
if {{comment_strings:14145683448}}=={{comment_strings:4784948838}} set /a co92=%co92%+1 
if {{comment_strings:33032642368}}=={{comment_strings:33115550543}} set /a co93=%co93%+1 
if {{comment_strings:43076635179}}=={{comment_strings:2111680523}} set /aco94=%co94%+1 

:10
cls

echo Frage 10:
echo.
echo set /p frage10=

if {{comment_strings:82165409098}}=={{comment_strings:4224654359}} set /a co101=%co101%+1 
if {{comment_strings:92005791470}}=={{comment_strings:32044841761}} set /a co102=%co102%+1 
if {{comment_strings:54287928975}}=={{comment_strings:82682945672}} set /a co103=%co103%+1 
if {{comment_strings:33888634431}}=={{comment_strings:81467037277}} set /a co104=%co104%+1 

:11
cls

set /p text1=Eintragen:

:12
cls

set /p text2=Eintragen:

:13
cls

set /p text3=Eintragen:

:14
cls

set /p text4=Eintragen:

:show

cls

echo.
echo Frage 1:
echo.
echo 1. %co11%
echo 2. %co12%
echo 3. %co13%
echo 4. %co14%
echo.
echo.
echo Frage 2:
echo.
echo 1. %co21%
echo 2. %co22%
echo 3. %co23%
echo 4. %co24%
echo.
echo.
echo Frage 3:
echo.
echo 1. %co31%
echo 2. %co32%
echo 3. %co33%
echo 4. %co34%
echo.
echo.
echo Frage 4:
echo.
echo 1. %co41%
echo 2. %co42%
echo 3. %co43%
echo 4. %co44%
echo.
echo.
echo Frage 5:
echo.
echo 1. %co51%
echo 2. %co52%
echo 3. %co53%
echo 4. %co54%
echo.
echo.
echo Frage 6:
echo.
echo 1. %co61%
echo 2. %co62%
echo 3. %co63%
echo 4. %co64%
echo.
echo.
echo Frage 7:
echo.
echo 1. %co71%
echo 2. %co72%
echo 3. %co73%
echo 4. %co74%
echo.
echo.
echo Frage 8:
echo.
echo 1. %co81%
echo 2. %co82%
echo 3. %co83%
echo 4. %co84%
echo.
echo.
echo Frage 9:
echo.
echo 1. %co91%
echo 2. %co92%
echo 3. %co93%
echo 4. %co94%
echo.
echo.
echo Frage 10:
echo.
echo 1. %co101%
echo 2. %co102%
echo 3. %co103%
echo 4. %co104%
echo.
echo.
echo Text 1:
echo.
echo %text1%
echo.
echo.
echo Text 2:
echo.
echo %text2%
echo.
echo.
echo Text 3:
echo.
echo %text3%
echo.
echo.
echo Text 4:
echo.
echo %text4%
echo. 
echo.
set /p right=Korrekt? (j/n)

if {{comment_strings:11274925157}}=={{comment_strings:14083397442}} goto save 
if {{comment_strings:31347322353}}=={{comment_strings:84019605509}} goto start 

if {{comment_strings:6138611268}}=={{comment_strings:82195557227}} goto save 
if {{comment_strings:72515477040}}=={{comment_strings:5684854715}} goto start 

if {{comment_strings:93103171517}}=={{comment_strings:42906549224}} goto save 
if {{comment_strings:13081443470}}=={{comment_strings:71003194011}} goto start 

if {{comment_strings:8184146616}}=={{comment_strings:7694316276}} goto save 
if {{comment_strings:9833483841}}=={{comment_strings:22987897804}} goto start 

:save

if {{comment_strings:24226280692}}=={{comment_strings:72483742899}} set /a cou11=%cou11%+1 & echo %cou11% > {{comment_strings:53613554603}} 
if {{comment_strings:51790932441}}=={{comment_strings:63453565126}} set /a cou12=%cou12%+1 & echo %cou12% > {{comment_strings:82934802767}} 
if {{comment_strings:32804929323}}=={{comment_strings:2192724152}} set /a cou13=%cou13%+1 & echo %cou13% > {{comment_strings:43981504097}} 
if {{comment_strings:33357479832}}=={{comment_strings:41158606175}} set /a cou14=%cou14%+1 & echo %cou14% > {{comment_strings:63646886405}} 

if {{comment_strings:33999145677}}=={{comment_strings:62018728376}} set /a cou21=%cou21%+1 & echo %cou21% > {{comment_strings:51804165328}} 
if {{comment_strings:52397697068}}=={{comment_strings:81513681963}} set /a cou22=%cou22%+1 & echo %cou22% > {{comment_strings:23055680882}} 
if {{comment_strings:7649980655}}=={{comment_strings:73532669801}} set /a cou23=%cou23%+1 & echo %cou23% > {{comment_strings:5648553815}} 
if {{comment_strings:32318897816}}=={{comment_strings:71899130944}} set /a cou24=%cou24%+1 & echo %cou24% > {{comment_strings:52183740097}} 

if {{comment_strings:11677635810}}=={{comment_strings:14026178734}} set /a cou31=%cou31%+1 & echo %cou31% > {{comment_strings:4607547729}} 
if {{comment_strings:53378584208}}=={{comment_strings:61644265334}} set /a cou32=%cou32%+1 & echo %cou32% > {{comment_strings:92575645904}} 
if {{comment_strings:5972138756}}=={{comment_strings:93137028904}} set /a cou33=%cou33%+1 & echo %cou33% > {{comment_strings:13276654609}} 
if {{comment_strings:41604062113}}=={{comment_strings:6242418465}} set /a cou34=%cou34%+1 & echo %cou34% > {{comment_strings:1426982611}} 

if {{comment_strings:91721109515}}=={{comment_strings:52723454645}} set /a cou41=%cou41%+1 & echo %cou41% > {{comment_strings:13611885149}} 
if {{comment_strings:3477065480}}=={{comment_strings:33194447412}} set /a cou42=%cou42%+1 & echo %cou42% > {{comment_strings:6194053494}} 
if {{comment_strings:32216206297}}=={{comment_strings:8734862133}} set /a cou43=%cou43%+1 & echo %cou43% > {{comment_strings:42337696386}} 
if {{comment_strings:8719446390}}=={{comment_strings:33725091661}} set /a cou44=%cou44%+1 & echo %cou44% > {{comment_strings:1461254022}} 

if {{comment_strings:73744077833}}=={{comment_strings:11053522357}} set /a cou51=%cou51%+1 & echo %cou51% > {{comment_strings:32450641054}} 
if {{comment_strings:5142876183}}=={{comment_strings:82784719360}} set /a cou52=%cou52%+1 & echo %cou52% > {{comment_strings:93541964902}} 
if {{comment_strings:12300529858}}=={{comment_strings:31128134131}} set /a cou53=%cou53%+1 & echo %cou53% > {{comment_strings:42093655466}} 
if {{comment_strings:63171066864}}=={{comment_strings:53368227321}} set /a cou54=%cou54%+1 & echo %cou54% > {{comment_strings:1437182387}} 

if {{comment_strings:23645667084}}=={{comment_strings:33240124782}} set /a cou61=%cou61%+1 & echo %cou61% > {{comment_strings:74111697833}} 
if {{comment_strings:7984027281}}=={{comment_strings:93411607358}} set /a cou62=%cou62%+1 & echo %cou62% > {{comment_strings:32010490331}} 
if {{comment_strings:14030582350}}=={{comment_strings:51014133693}} set /a cou63=%cou63%+1 & echo %cou63% > {{comment_strings:1520967077}} 
if {{comment_strings:1320782969}}=={{comment_strings:4909919979}} set /a cou64=%cou64%+1 & echo %cou64% > {{comment_strings:32959115524}} 

if {{comment_strings:92989819682}}=={{comment_strings:2250619063}} set /a cou71=%cou71%+1 & echo %cou71% > {{comment_strings:64203797852}} 
if {{comment_strings:33320524430}}=={{comment_strings:22660016877}} set /a cou72=%cou72%+1 & echo %cou72% > {{comment_strings:11304156008}} 
if {{comment_strings:3159074098}}=={{comment_strings:83739903352}} set /a cou73=%cou73%+1 & echo %cou73% > {{comment_strings:5828360661}} 
if {{comment_strings:31821191843}}=={{comment_strings:7229682136}} set /a cou74=%cou74%+1 & echo %cou74% > {{comment_strings:81539410077}} 

if {{comment_strings:22089298169}}=={{comment_strings:63134981972}} set /a cou81=%cou81%+1 & echo %cou81% > {{comment_strings:3299127678}} 
if {{comment_strings:2536194360}}=={{comment_strings:9321060241}} set /a cou82=%cou82%+1 & echo %cou82% > {{comment_strings:51928768455}} 
if {{comment_strings:23034372733}}=={{comment_strings:44103899818}} set /a cou83=%cou83%+1 & echo %cou83% > {{comment_strings:43932882120}} 
if {{comment_strings:21956000175}}=={{comment_strings:41230522309}} set /a cou84=%cou84%+1 & echo %cou84% > {{comment_strings:91984018296}} 

if {{comment_strings:51736198813}}=={{comment_strings:13881357770}} set /a cou91=%cou91%+1 & echo %cou91% > {{comment_strings:41485530148}} 
if {{comment_strings:44131806850}}=={{comment_strings:92708353661}} set /a cou92=%cou92%+1 & echo %cou92% > {{comment_strings:52180454357}} 
if {{comment_strings:73323216221}}=={{comment_strings:13892148686}} set /a cou93=%cou93%+1 & echo %cou93% > {{comment_strings:8966734318}} 
if {{comment_strings:84258115845}}=={{comment_strings:73344193435}} set /a cou94=%cou94%+1 & echo %cou94% > {{comment_strings:91238995797}} 

if {{comment_strings:11546899958}}=={{comment_strings:41256734794}} set /a cou101=%cou101%+1 & echo %cou101% > {{comment_strings:43906075870}} 
if {{comment_strings:73549092056}}=={{comment_strings:1764698394}} set /a cou102=%cou102%+1 & echo %cou102% > {{comment_strings:31599626417}} 
if {{comment_strings:42220886396}}=={{comment_strings:23959952871}} set /a cou103=%cou103%+1 & echo %cou103% > {{comment_strings:83686643168}} 
if {{comment_strings:1488250502}}=={{comment_strings:92495137786}} set /a cou104=%cou104%+1 & echo %cou104% > {{comment_strings:9499364743}} 

echo %text1% >> {{comment_strings:71839456832}} 
echo %text2% >> {{comment_strings:32710151948}} 
echo %text3% >> {{comment_strings:51010185312}} 
echo %text4% >> {{comment_strings:53987295925}} 

xcopy {{comment_strings:21069331751}} {{comment_strings:13358236840}} 

set /a anzahl={{comment_strings:51138465478}}+1  
echo %anzahl% Durchgaenge > {{comment_strings:53760278737}} 

goto start

Content-Key: 190568

Url: https://administrator.de/contentid/190568

Printed on: April 19, 2024 at 07:04 o'clock

Mitglied: 86263
86263 Sep 01, 2012 at 12:45:56 (UTC)
Goto Top
Hallo checkex,

würdest du bitte so freundlich sein, den Quellcode in -Formatierung zu setzen
und dann die Zeile angeben, in der du nicht weiter kommst.


Gruß,
DB
Member: rubberman
rubberman Sep 01, 2012 updated at 13:00:38 (UTC)
Goto Top
Hallo checkex!

Das ist ja Spaghetticode in Reinstform face-sad (und dann, wie DGzRSBorkum schon angemerkt hat, auch noch ohne Codeformatierung hier rein gesetzt). Zu viel, um da den Durchblick zu bekommen. Auf den ersten Blick:
Was denkst du macht das ECHO in
echo set /p frage2=
???

Grüße
rubberman
Mitglied: 60730
60730 Sep 01, 2012 updated at 14:35:14 (UTC)
Goto Top
Salve,

Zitat von @checkex:
Das Problem ist, dass nach der ersten Abfrage einfach die ganzen anderen Abfragen bis zur Text-Abfrage übersprungen werden.
Ehrlich gesagt habe ich dazu keine Idee mehr ( am besten runterladen & selbst ansehen).

Hab ich mal gemacht, von der quelle, die du da in deinem Profil angegeben hast.
[OT]
Das erstellte Programm sollte jetzt so aussehen:

@Echo off
echo Wollen sie wirklich die Dateien in C:\Dokumente nach

echo E:\Dokumente kopieren?
echo.
echo.
pause
xcopy C:\Dokumente E:\Dokumente
;exit
Hört sich nach nem minimummaximum Problem an, aber Hauptsache, dass @echo off steht führend da.

Junxxs und Mäddelzz, backt doch kleinere Brötchen. Oder wie der Neffe meines Onkels mal schrieb, nur der der was wissen tut, der kann sein wissen weitergeben.#

[/OT]

Gruß
Member: bastla
bastla Sep 01, 2012, updated at Sep 02, 2012 at 08:03:32 (UTC)
Goto Top
[OT] @t-mo
Die mangelnde Eleganz bei der "xcopy"-Zielangabe wird aber wenigstens durch ein nicht alltägliches
;exit
wieder wettgemacht - ok, tatsächlich enthält zwar die Zeile zwei überflüssige Bestandteile (";" und "exit"), aber wer wird denn kleinlich sein ... face-wink

Grüße
bastla
[/OT]
Member: pieh-ejdsch
pieh-ejdsch Sep 01, 2012, updated at Sep 02, 2012 at 10:21:27 (UTC)
Goto Top
moin,

immer wieder gern Gesehen und dazu auch aus unseren Top Pfeif, dafür schon ChroNoLogisch geordent:
1. ( am besten runterladen & selbst ansehen).
2. Vielen Dank im Vorraus für Antworten & Lösungen
3. Quellcode: Natürlich wie immer ohne tag Einfassung [/edit2 wurde jetzt nachgezogen]
4. echo off ja Klar - der ist fast neu, sonst mit Führendem @ hätt es so in die Top 3 geschafft.
5. echo Zensiert :D hmmm - solch unwichtige Sachen brauchts hier eh nicht.
<edit>Zu spät beachtet aber wegen der Geschwindigkeit mit aufgenommen:
0. bräuchte ich schnelle Hilfe
</edit>

So eine Art von Sagetticode habe ich auch für die CMD-Line (deckt 80 Prozent mit Majo oder Ketschup ab):
(for /f "delims==" %i in ('set Q') do @set "%i=")&@for /l %i in (201 1 210) do @cls &for /f "tokens=*delims=2" %i in ("%i") do @(set "Q%i0=Frage %i:"&(for /f "tokens=1*delims==" %a in ('set Q') do @echo %b)&set /p "Q%i1=Geben Sie Ihre Antwort an 1 ... 4 " )  

Gruß Phil