cyprian
Goto Top

Textausgabe in Datei aus Batch Script

Hallo,

möchte eine DFÜ Verbindung abfragen und den Inhalt in eine LOG Datei schreiben lassen.

CODE:

@echo
rasdial "DFÜ Name"
ping localhost -n 3 >NUL
echo >> statusreport_%date%.txt "ISDN Einwahl bei ... klappt! %time%"
goto end
if errorlevel 1 goto nichtda
echo >> statusreport_%date%.txt "ISDN Einwahl bei ... klappt nicht! %time%"
:end
rasdial "DFÜ Name" /Disconnect

Wenn die Verbindung nicht zu Stande kommt, schreibt er mir trotzdem, dass die Einwahl korrekt war, was ist falsch???

cyprian

Content-Key: 23669

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

Printed on: April 24, 2024 at 20:04 o'clock

Member: Janni
Janni Jan 16, 2006 at 11:25:50 (UTC)
Goto Top
so kann das auch nicht gehen, da Du das "Erfolgsecho" immer ausführst und das andere wird nicht ausgeführt, da es zu "nichtda" geht, was nicht existiert.
Probiere mal:

if errorlevel 1 (
echo >> statusreport_%date%.txt "ISDN Einwahl bei ... klappt nicht! %time%"
) else (
echo >> statusreport_%date%.txt "ISDN Einwahl bei ... klappt! %time%")

MFG