Write to Windows event log: Difference between revisions
Content added Content deleted
Simple9371 (talk | contribs) m (→{{header|Batch File}}: Changed to the proper way to hide output (>NUL 2>&1)) |
|||
Line 238: | Line 238: | ||
If you do not want the command to display its result or errors... |
If you do not want the command to display its result or errors... |
||
<lang dos>@echo off |
<lang dos>@echo off |
||
EventCreate /t ERROR /id 123 /l SYSTEM /so "A Batch File" /d "This is found in system log." |
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" |
EventCreate /t WARNING /id 456 /l APPLICATION /so BlaBla /d "This is found in apps log" >NUL 2>&1 |
||
::That " |
::That ">NUL 2>&1" trick actually works in any command!</lang> |
||
'''NOTE:''' This will (...or might) not work if you do not have administrator privileges. |
'''NOTE:''' This will (...or might) not work if you do not have administrator privileges. |