RosettaCodeData/Task/Write-to-Windows-event-log/Batch-File/write-to-windows-event-log-2.bat
2023-07-01 13:44:08 -04:00

4 lines
266 B
Batchfile

@echo off
EventCreate /t ERROR /id 123 /l SYSTEM /so "A Batch File" /d "This is found in system log." >NUL 2>&1
EventCreate /t WARNING /id 456 /l APPLICATION /so BlaBla /d "This is found in apps log" >NUL 2>&1
::That ">NUL 2>&1" trick actually works in any command!