Write to Windows event log: Difference between revisions

Content added Content deleted
Line 286: Line 286:
<lang clojure>(use 'clojure.java.shell)
<lang clojure>(use 'clojure.java.shell)
(sh "eventcreate" "/T" "INFORMATION" "/ID" "123" "/D" "Rosetta Code example")</lang>
(sh "eventcreate" "/T" "INFORMATION" "/ID" "123" "/D" "Rosetta Code example")</lang>

=={{header|D}}==
{{trans|Kotlin}}
<lang D>import std.process;
import std.stdio;

void main() {
auto cmd = executeShell(`EventCreate /t INFORMATION /id 123 /l APPLICATION /so Dlang /d "Rosetta Code Example"`);

if (cmd.status == 0) {
writeln("Output: ", cmd.output);
} else {
writeln("Failed to execute command, status=", cmd.status);
}
}</lang>


=={{header|Delphi}}==
=={{header|Delphi}}==