batch datei frage

Konfiguration, Anwendungen, Treiber und TSRs unter DOS
Antworten
wollev45

batch datei frage

Beitrag von wollev45 »

Moin :-)

Ich hab da ein kleines problem...

Auf meinem server habe ich einen arma3 server laufen den ich mit einer batch datei
Updaten kann.
In der batch datei müssen die steam zugangsdaten eingetragen werden.
Aus sicherheitsgründen habe ich diese daten aber nicht in der batch datei stehen.
Ich muss also umständlich vor jedem updateprozess die datei öffnen und editieren.
Da ich dies nicht alleine mache sondern noch zwei weitere kollegen wollte ich dies ein wenig
vereinfachen.
Ist es möglich das ich die entsprechenden informationen während des ausführens der datei eingeben kann ?
Ich weis das ich irgend wann und bei irgend einer dos installation mal ein paar eingaben machen musste, allerdings habe ich keinen plan wie ich das lösen könnte.

Hat jemand nen tipp ?
Benutzeravatar
matze79
DOS-Gott
Beiträge: 7910
Registriert: So 9. Sep 2012, 20:48

Re: batch datei frage

Beitrag von matze79 »

Es geht also nicht um DOS Batch nehm ich mal an sondern um Windows NT cmd.exe ? oder um PowerShell batch ?

Dann ist die Frage im Falschen Forum :)

Aber trotzdem:
https://www.google.de/search?q=Batch+Pr ... 0AWQtoH4BA
https://www.shadowcircuit.de - Die kleine Community rund um Retro Computing
https://www.retroianer.de
wollev45

Re: batch datei frage

Beitrag von wollev45 »

Doch es ist eine dos batch.
Wenn ich in google schlau geworden wäre würde ich hier nicht fragen, trotzdem danke :-(
Benutzeravatar
CptKlotz
Admin a.D.
Beiträge: 2947
Registriert: Mo 7. Mär 2005, 23:36
Wohnort: Dorsten
Kontaktdaten:

Re: batch datei frage

Beitrag von CptKlotz »

@wolle: Sicher, daß du die Forenregeln gelesen hast?
“It is impossible to defeat an ignorant man in argument.” (William G. McAdoo)
freecrac
DOS-Guru
Beiträge: 861
Registriert: Mi 21. Apr 2010, 11:44
Wohnort: Hamburg Horn

Re: batch datei frage

Beitrag von freecrac »

Moin.
wollev45 hat geschrieben:Doch es ist eine dos batch.
Wenn ich in google schlau geworden wäre würde ich hier nicht fragen, trotzdem danke :-(
Unter DOS bis einschliesslich version 7 gibt es dafür wohl keine Hilfe vom OS.

Wenn ich das richtig sehe geht es ab Windos NT mit cmd. exe und dem "set /p"-Befehl:
http://de.wikibooks.org/wiki/Batch-Prog ... Windows_NT

...

Für pures DOS würde ich sonst eine kleine Anwendung mit INT 21 AH=0A schreiben, womit eine Eingabezeile mit blinkenden Cursor erscheint und wo man eine vorher festgelegte Anzahl an Zeichen eintippen und mit der Eingabe-Taste übernehmen kann. Danach wird eine neue Textdatei mit den vorher eingetippten Zeichen erstellt und die Anwendung beendet. Danach kann diese Textdatei anderen Anwendungen als Parameter mit übergeben werden. Anschliessend wird diese neue Textdatei wieder gelöscht.

Dafür nötige Software-Interrupts:
INT 21h Funktionen BUFFERED INPUT, CREATE FILE, WRITE TO FILE, CLOSE FILE

RBIL->inter61b.zip->INTERRUP.F

Code: Alles auswählen

--------D-210A-------------------------------
INT 21 - DOS 1+ - BUFFERED INPUT
	AH = 0Ah
	DS:DX -> buffer (see #01344)
Return: buffer filled with user input
Notes:	^C/^Break are checked, and INT 23 is called if either detected
	reads from standard input, which may be redirected under DOS 2+
	if the maximum buffer size (see #01344) is set to 00h, this call returns
	  immediately without reading any input
SeeAlso: AH=0Ch,INT 2F/AX=4810h

Format of DOS input buffer:
Offset	Size	Description	(Table 01344)
 00h	BYTE	maximum characters buffer can hold
 01h	BYTE	(call) number of chars from last input which may be recalled
		(ret) number of characters actually read, excluding CR
 02h  N BYTEs	actual characters read, including the final carriage ret

--------D-213C-------------------------------
INT 21 - DOS 2+ - "CREAT" - CREATE OR TRUNCATE FILE
	AH = 3Ch
	CX = file attributes (see #01401)
	DS:DX -> ASCIZ filename
Return: CF clear if successful
	    AX = file handle
	CF set on error
	    AX = error code (03h,04h,05h) (see #01680 at AH=59h/BX=0000h)
Notes:	if a file with the given name exists, it is truncated to zero length
	under the FlashTek X-32 DOS extender, the pointer is in DS:EDX
	DR DOS checks the system password or explicitly supplied password at
	  the end of the filename against the reserved field in the directory
	  entry before allowing access
SeeAlso: AH=16h,AH=3Dh,AH=5Ah,AH=5Bh,AH=93h,INT 2F/AX=1117h

Bitfields for file attributes:
Bit(s)	Description	(Table 01401)
 0	read-only
 1	hidden
 2	system
 3	volume label (ignored)
 4	reserved, must be zero (directory)
 5	archive bit
 7	if set, file is shareable under Novell NetWare

--------D-2140-------------------------------
INT 21 - DOS 2+ - "WRITE" - WRITE TO FILE OR DEVICE
	AH = 40h
	BX = file handle
	CX = number of bytes to write
	DS:DX -> data to write
Return: CF clear if successful
	    AX = number of bytes actually written
	CF set on error
	    AX = error code (05h,06h) (see #01680 at AH=59h/BX=0000h)
Notes:	if CX is zero, no data is written, and the file is truncated or
	  extended to the current position
	data is written beginning at the current file position, and the file
	  position is updated after a successful write
	for FAT32 drives, the file must have been opened with AX=6C00h with
	  the "extended size" flag in order to expand the file beyond 2GB;
	  otherwise the write will fail with error code 0005h (access denied)
	the usual cause for AX < CX on return is a full disk
BUG:	a write of zero bytes will appear to succeed when it actually failed
	  if the write is extending the file and there is not enough disk
	  space for the expanded file (DOS 5.0-6.0); one should therefore check
	  whether the file was in fact extended by seeking to 0 bytes from
	  the end of the file (INT 21/AX=4202h/CX=0000h/DX=0000h)
	under the FlashTek X-32 DOS extender, the pointer is in DS:EDX
SeeAlso: AH=28h,AH=3Fh"DOS",AH=93h,INT 2F/AX=1109h

--------D-213E-------------------------------
INT 21 - DOS 2+ - "CLOSE" - CLOSE FILE
	AH = 3Eh
	BX = file handle
Return: CF clear if successful
	    AX destroyed
	CF set on error
	    AX = error code (06h) (see #01680 at AH=59h/BX=0000h)
Notes:	if the file was written to, any pending disk writes are performed, the
	  time and date stamps are set to the current time, and the directory
	  entry is updated
	recent versions of DOS preserve AH because some versions of Multiplan
	  had a bug which depended on AH being preserved
SeeAlso: AH=10h,AH=3Ch,AH=3Dh,INT 2F/AX=1106h,INT 2F/AX=1227h
Dirk
Antworten