ich hab da mal ein Problem, ich möchte eine Art "Datenbank" machen die nach dem Alphabet sortiert ist und mit Batch abgerufen werden kann, also hier der Code schnippsel:
@echo off set /p objekt=[A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] echo [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z]>>NUL
if "%objekt%"=="A" goto A if "%objekt%"=="B" goto B if "%objekt%"=="C" goto C if "%objekt%"=="D" goto D if "%objekt%"=="E" goto E if "%objekt%"=="F" goto F if "%objekt%"=="G" goto G if "%objekt%"=="H" goto H if "%objekt%"=="I" goto I if "%objekt%"=="J" goto J if "%objekt%"=="K" goto K if "%objekt%"=="L" goto L if "%objekt%"=="M" goto M if "%objekt%"=="N" goto N if "%objekt%"=="O" goto O if "%objekt%"=="P" goto P if "%objekt%"=="Q" goto Q if "%objekt%"=="R" goto R if "%objekt%"=="S" goto S if "%objekt%"=="T" goto T if "%objekt%"=="U" goto U if "%objekt%"=="V" goto V if "%objekt%"=="W" goto W if "%objekt%"=="X" goto X if "%objekt%"=="Y" goto Y if "%objekt%"=="Z" goto Z
:A type A.dat | more pause exit :B type B.dat pause exit :C type C.dat | more pause exit :D type D.dat | more pause exit :E type E.dat | more pause exit :F type F.dat | more pause exit :G type G.dat | more pause exit :H type H.dat | more pause exit :I type I.dat | more pause exit :J type J.dat | more pause exit :K type K.dat | more pause exit :L type L.dat | more pause exit :M type M.dat | more pause exit :N type N.dat | more pause exit :O type O.dat | more pause exit :P type P.dat | more pause exit :Q type Q.dat |more pause exit :R type R.dat | more pause exit :S type S.dat | more pause exit :T type T.dat | more pause exit :U type U.dat | more pause exit :V type V.dat | more pause exit :W type W.dat | more pause exit :X type X.dat | more pause exit :Y type Y.dat | more pause exit :Z type Z.dat | more pause exit
Ich weiß ein ziemlich großer "Schnipsel" mein Problem ist das beim auswählen aller Buchstaben immer die Daten von A.dat angezeigt werden. Kann mir jemand helfen damit ich auch auf diese Weise die anderen Dateien B.dat....Z.dat lesen kann
So wie Du es schreibst funktioniert es nur mit Großbuchstaben, sprich Dein Skript erwartet A und nicht a. Probiere folgendes:
if /i "%objekt%"=="A" goto A if /i "%objekt%"=="B" goto B if /i "%objekt%"=="C" goto C ...
Nachtrag:
/i : Forces string comparisons to ignore case. You can use /i on the string1==string2 form of if. These comparisons are generic, in that if both string1 and string2 are both comprised of all numeric digits, the strings are converted to numbers and a numeric comparison is performed.
Hallo CodeSniffer, danke für deine schnelle Antwort, aber es funktioniert leider nicht. Hast du versucht den Code in eine Batch zu packen und zu testen ob es bei dir funktioniert
vicon