software:diy:batch:aes
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| software:diy:batch:aes [17/12/2011 02:12] – internen Link eingefügt uxt | software:diy:batch:aes [22/09/2022 21:09] (aktuell) – [Erste Versuche] Rechtschreibung bttr | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== Batchen im AES-Look ====== | ||
| + | AES steht für " | ||
| + | Dies geht zwar schon allein mit den internen DOS-Befehlen, | ||
| + | Diese Utilities/ | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | * [[software: | ||
| + | *GETFILE.EXE -- Ermöglicht das Laden/ | ||
| + | |||
| + | Diese Dateien sind im [[software: | ||
| + | |||
| + | Downloaden, zum Pofo übertragen, | ||
| + | |||
| + | ===== Erste Versuche ===== | ||
| + | Wir schreiben uns folgende Batchdatei: | ||
| + | <code dos> | ||
| + | BOX | ||
| + | CSRPOS 1,5 | ||
| + | ECHO AES-Batchen | ||
| + | CSRPOS 2,3 | ||
| + | ECHO Mit dieser Batchdatei und ein paar | ||
| + | CSRPOS 3,3 | ||
| + | ECHO Utilities kann ich mir meine eigene | ||
| + | CSRPOS 4,3 | ||
| + | ECHO AES-Umgebung zurecht-batchen. | ||
| + | SCRSTR.COM SCR0.PGT | ||
| + | </ | ||
| + | |||
| + | Nennen wir sie MKAES01.BAT. Wenn wir sie ausführen, sehen wir dabei zu, wie DOS uns einen Startbildschirm " | ||
| + | |||
| + | Nun ein kleines Hauptprogramm: | ||
| + | <code dos> | ||
| + | :START | ||
| + | SCRRST SCR0.PGT | ||
| + | SET FILENAME=UNSET | ||
| + | GETFILE *.* | ||
| + | IF %FILENAME%==UNSET GOTO ENDE | ||
| + | CLS | ||
| + | ECHO %FILENAME% | ||
| + | PAUSE >NUL | ||
| + | SET FILENAME== | ||
| + | CLS | ||
| + | SCRRST SCR0.PGT | ||
| + | GOTO START | ||
| + | :ENDE | ||
| + | </ | ||
| + | |||
| + | Nennen wir es AES.BAT. Starten wir diese Batchdatei, erscheint unser vorher generierter Startbildschirm und ein Fenster mit allen auf dem gegenwärtigen Pfad befindlichen Dateien. Mit den Pfeiltasten oder durch Drücken eines der Anfangsbuchstaben wählen wir sie aus. Dies erledigt GETFILE.EXE. Haben wir eine Datei ausgewählt, | ||
| + | Sie löschen: DEL %FILENAME% \\ | ||
| + | Sie ansehen: TYPE %FILENAME% \\ | ||
| + | Sie kopieren: COPY %FILENAME% C:\*.* \\ | ||
| + | usw. \\ | ||
| + | Im obigen Beispiel wird der Name auf einem leeren Bildschirm dargestellt ('' | ||
| + | |||
| + | ===== Ladebalken ===== | ||
| + | Na ja, dies ist nicht AES-typisch, | ||
| + | |||
| + | <code dos> | ||
| + | scrstr SCREEN0.PGT | ||
| + | csrmod /o | ||
| + | csrpos 4,10 | ||
| + | box 3,20 | ||
| + | csrpos 4,14 | ||
| + | echo loading... | ||
| + | csrpos 5,11 | ||
| + | echo █ | ||
| + | csrpos 5,12 | ||
| + | echo ██ | ||
| + | csrpos 5,14 | ||
| + | echo ██ | ||
| + | csrpos 5,16 | ||
| + | echo ██ | ||
| + | csrpos 5,18 | ||
| + | echo ███ | ||
| + | csrpos 5,21 | ||
| + | echo █ | ||
| + | csrpos 5,22 | ||
| + | echo █ | ||
| + | csrpos 5,23 | ||
| + | echo █ | ||
| + | csrpos 5,24 | ||
| + | echo ██ | ||
| + | csrpos 5,26 | ||
| + | echo ██║ | ||
| + | pause >nul | ||
| + | scrrst SCREEN0.PGT | ||
| + | csrmod /b | ||
| + | </ | ||
| + | |||
| + | Zwischen ECHO und CSRPOS können jeweils Teile einer Routine eingefügt werden. So kann man anhand des wachsenden Balkens das Fortschreiten der Gesamtroutine beobachten. | ||
| + | |||
| + | |||
| + | ===== Elementarer Filemanager ===== | ||
| + | Eine etwas komlexere Batch-Datei die so etwas ähnliches wie ein Filemanager ist. Das Programm prüft am Anfang ob alle erforderlichen Utilities und Tools zur Verfügung stehen. Es wird eine gewisse Verzeichnis-Struktur vorausgesetzt (A: | ||
| + | |||
| + | <code dos> | ||
| + | @echo off | ||
| + | echo checking environment integrity... | ||
| + | if not exist a: | ||
| + | if not exist a: | ||
| + | if not exist a: | ||
| + | if not exist a: | ||
| + | if not exist a: | ||
| + | scrrst a: | ||
| + | csrpos 7,39 | ||
| + | pause >nul | ||
| + | csrmod /o | ||
| + | csrpos 4,10 | ||
| + | box 3,20 | ||
| + | csrpos 4,14 | ||
| + | echo loading... | ||
| + | csrpos 5,11 | ||
| + | echo █ | ||
| + | if not exist a: | ||
| + | csrpos 5,12 | ||
| + | echo ██ | ||
| + | if not exist a: | ||
| + | if not exist a: | ||
| + | csrpos 5,14 | ||
| + | echo ██ | ||
| + | if not exist a: | ||
| + | csrpos 5,16 | ||
| + | echo ██ | ||
| + | csrpos 5,18 | ||
| + | echo ███ | ||
| + | csrpos 5,21 | ||
| + | echo █ | ||
| + | csrpos 5,22 | ||
| + | echo █ | ||
| + | csrpos 5,23 | ||
| + | echo █ | ||
| + | csrpos 5,24 | ||
| + | echo ██ | ||
| + | csrpos 5,26 | ||
| + | echo ██║ | ||
| + | csrpos 7,1 | ||
| + | scrrst a: | ||
| + | csrpos 4,4 | ||
| + | box 3,33 | ||
| + | csrpos 5,6 | ||
| + | echo welcome to batch-environment! | ||
| + | csrmod /b | ||
| + | csrpos 5,35 | ||
| + | chkdsk >nul | ||
| + | csrmod /o | ||
| + | scrrst a: | ||
| + | goto main | ||
| + | |||
| + | :noaes2 | ||
| + | scrstr c: | ||
| + | csrpos 3,5 | ||
| + | box 3,34 | ||
| + | csrpos 4,7 | ||
| + | echo sorry, environment incomplete. | ||
| + | chkdsk >nul | ||
| + | scrrst a: | ||
| + | pause >nul | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto quit | ||
| + | |||
| + | :main | ||
| + | csrpos 2,17 | ||
| + | csrmod /b | ||
| + | menu main apps commands tools dos quit | ||
| + | if errorlevel 5 goto quit | ||
| + | if errorlevel 4 goto dos | ||
| + | if errorlevel 3 goto tools | ||
| + | if errorlevel 2 goto commands | ||
| + | if errorlevel 1 goto apps | ||
| + | goto quit | ||
| + | |||
| + | :apps | ||
| + | a: | ||
| + | scrstr c: | ||
| + | :appmenu | ||
| + | menu apps adr dry wks txt cal | ||
| + | if errorlevel 5 goto cal | ||
| + | if errorlevel 4 goto txt | ||
| + | if errorlevel 3 goto wks | ||
| + | if errorlevel 2 goto dry | ||
| + | if errorlevel 1 goto adr | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto main | ||
| + | |||
| + | :adr | ||
| + | scrstr c: | ||
| + | set spec=a: | ||
| + | set appl=/a | ||
| + | goto getapp | ||
| + | |||
| + | :dry | ||
| + | scrstr c: | ||
| + | set spec=a: | ||
| + | set appl=/d | ||
| + | goto getapp | ||
| + | |||
| + | :wks | ||
| + | scrstr c: | ||
| + | set spec=a: | ||
| + | set appl=/w | ||
| + | goto getapp | ||
| + | |||
| + | :txt | ||
| + | scrstr c: | ||
| + | set spec=a: | ||
| + | set appl=/e | ||
| + | goto getapp | ||
| + | |||
| + | :cal | ||
| + | scrstr c: | ||
| + | app /c | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto appmenu | ||
| + | |||
| + | :quit | ||
| + | csrmod /o | ||
| + | scrrst a: | ||
| + | csrpos 4,10 | ||
| + | box 3,18 | ||
| + | csrpos 5,12 | ||
| + | echo leaving AES... | ||
| + | csrpos 5,26 | ||
| + | csrmod /b | ||
| + | goto end | ||
| + | |||
| + | :getapp | ||
| + | if not exist %spec% goto nofil | ||
| + | if not exist c: | ||
| + | set filename=unset | ||
| + | getfile %spec% | ||
| + | if %filename%==unset goto appret | ||
| + | set cmd=alf a: | ||
| + | %cmd% | ||
| + | app %appl% | ||
| + | set spec= | ||
| + | set filename= | ||
| + | set appl= | ||
| + | set cmd= | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto appmenu | ||
| + | |||
| + | :appret | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | set spec= | ||
| + | set filename= | ||
| + | set appl= | ||
| + | set cmd= | ||
| + | goto appmenu | ||
| + | |||
| + | :nofil | ||
| + | msg no matching file found. | ||
| + | goto appret | ||
| + | |||
| + | :nopd | ||
| + | copy a: | ||
| + | goto getapp | ||
| + | |||
| + | :commands | ||
| + | scrstr c: | ||
| + | :commenu | ||
| + | set filename=unset | ||
| + | set spec=a: | ||
| + | if not exist %spec% goto nocom | ||
| + | getfile %spec% | ||
| + | if %filename%==unset goto comret | ||
| + | scrstr c: | ||
| + | cls | ||
| + | %filename% | ||
| + | pause | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | set filename= | ||
| + | set spec= | ||
| + | goto commenu | ||
| + | |||
| + | :comret | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto main | ||
| + | |||
| + | :nocom | ||
| + | msg no matching file found. | ||
| + | set filename= | ||
| + | set spec= | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto main | ||
| + | |||
| + | :tools | ||
| + | scrstr c: | ||
| + | :toolmenu | ||
| + | set filename=unset | ||
| + | set spec=a: | ||
| + | if not exist %spec% goto noexe | ||
| + | getfile %spec% | ||
| + | if %filename%==unset goto exeret | ||
| + | scrstr c: | ||
| + | if not %filename%==TCCALC.COM cls | ||
| + | %filename% | ||
| + | csrpos 8,3 | ||
| + | pause | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | set filename= | ||
| + | set spec= | ||
| + | goto toolmenu | ||
| + | |||
| + | :exeret | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto main | ||
| + | |||
| + | :noexe | ||
| + | msg no matching file found. | ||
| + | set filename= | ||
| + | set spec= | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto main | ||
| + | |||
| + | :dos | ||
| + | scrstr c: | ||
| + | :dosmenu | ||
| + | menu DOS dir chkdsk time label | ||
| + | if errorlevel 4 goto doslab | ||
| + | if errorlevel 3 goto dostim | ||
| + | if errorlevel 2 goto doschkdsk | ||
| + | if errorlevel 1 goto dosdir | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto main | ||
| + | |||
| + | :dosdir | ||
| + | scrstr c: | ||
| + | cls | ||
| + | dir /p | ||
| + | pause | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto dosmenu | ||
| + | |||
| + | :doschkdsk | ||
| + | scrstr c: | ||
| + | cls | ||
| + | chkdsk /p | ||
| + | csrpos 8,1 | ||
| + | pause | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto dosmenu | ||
| + | |||
| + | :dostim | ||
| + | scrstr c: | ||
| + | cls | ||
| + | csrpos 3,1 | ||
| + | time | ||
| + | date | ||
| + | pause | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto dosmenu | ||
| + | |||
| + | :doslab | ||
| + | scrstr c: | ||
| + | cls | ||
| + | csrpos 3,1 | ||
| + | label | ||
| + | pause | ||
| + | scrrst c: | ||
| + | del c: | ||
| + | goto dosmenu | ||
| + | |||
| + | |||
| + | :noaes | ||
| + | echo sorry, environment incomplete. | ||
| + | goto exit | ||
| + | |||
| + | :end | ||
| + | set filename= | ||
| + | set spec= | ||
| + | |||
| + | del c: | ||
| + | scrrst a: | ||
| + | csrmod /b | ||
| + | :exit | ||
| + | </ | ||
| + | |||
| + | Download: {{: | ||
| + | |||
| + | | ||
