Dateien mit bestimmtem Inhalt im Namen kopieren
Ich habe in einem Ordner folgende log Dateien liegen
2018-02-20_162254_UBIMET8GB.log
2018-02-20_170006_UBIMET8GB.log
2018-02-21_053402_UBIMET8GB.log
2018-02-21_170005_UBIMET8GB[Gestoppt].log
2018-02-21_175857_UBIMET8GB[Fehler].log
2018-02-21_180245_UBIMET8GB.log
2018-02-21_181652_UBIMET8GB.log
2018-02-21_181712_UBIMET8GB.log
Wenn in der Liste eine Datei den String "[Fehler]" enthält, würde ich diese Datei gerne via Batch per Mail versenden!
Ich habe nahezu alle Funktionen bereits fertig, nur die Auswahl der entsprechenden Datei noch nicht!
Ich vermute ich kann das irgendwie mit Findst machen, habe aber keine Ahnung wie ich anfangen soll.
Habt ihr eventuell Starthilfe für mich was die AUswahl mit findstr oder so betrifft?
2018-02-20_162254_UBIMET8GB.log
2018-02-20_170006_UBIMET8GB.log
2018-02-21_053402_UBIMET8GB.log
2018-02-21_170005_UBIMET8GB[Gestoppt].log
2018-02-21_175857_UBIMET8GB[Fehler].log
2018-02-21_180245_UBIMET8GB.log
2018-02-21_181652_UBIMET8GB.log
2018-02-21_181712_UBIMET8GB.log
Wenn in der Liste eine Datei den String "[Fehler]" enthält, würde ich diese Datei gerne via Batch per Mail versenden!
Ich habe nahezu alle Funktionen bereits fertig, nur die Auswahl der entsprechenden Datei noch nicht!
Ich vermute ich kann das irgendwie mit Findst machen, habe aber keine Ahnung wie ich anfangen soll.
Habt ihr eventuell Starthilfe für mich was die AUswahl mit findstr oder so betrifft?
Please also mark the comments that contributed to the solution of the article
Content-Key: 365755
Url: https://administrator.de/contentid/365755
Printed on: April 20, 2024 at 03:04 o'clock
2 Comments
Latest comment
for /f "delims=" %%a in ('dir /b /a-d *Fehler*.log 2^>nul') do (
echo %%a
)
Gruß Snap