Last active
October 15, 2020 12:52
-
-
Save rolangom/2e4b71d0ef5049661762269475241341 to your computer and use it in GitHub Desktop.
Create Windows events using Python 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create windows events | |
""" | |
import os | |
def create_event(srcname: str, type: str, id: int, description: str): | |
command = f'eventcreate /t {type} /id {id} /l application /so {srcname} /d "{description}"' | |
os.system(f'cmd /c "{command}"') | |
def post_info_event(srcname: str, id: int, description: str): | |
create_event(srcname, "INFORMATION", id, description) | |
def post_error_event(srcname: str, id: int, description: str): | |
create_event(srcname, "ERROR", id, description) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment