Skip to main content

A module to provide simplified system calls on Windows

Project description

WinUtils

A module for Windows utilities

Installation:

pip install winutils

Examples:

import WinUtils as wu
wu.Shutdown(wu.SHTDN_REASON_MINOR_OTHER) # Shutdown other error, minor
wu.Restart(wu.SHTDN_REASON_MAJOR_SOFTWARE) # Restart Software error, major
wu.LogOut(wu.SHTDN_REASON_MINOR_HOTFIX) # Log out user hot fix, minor

Reference:

Functions:

Shutdown(condition) - Shut down the device, condition is logged by the system Restart(condition) - Restart the device, condition is logged by the system LogOut(condition) - Logs out the user from the device, condition is logged by the system

All Error Codes:

Major flags:

SHTDN_REASON_MAJOR_APPLICATION: Application issue

SHTDN_REASON_MAJOR_HARDWARE: Hardware issue

SHTDN_REASON_MAJOR_OPERATINGSYSTEM: Operating system issue

SHTDN_REASON_MAJOR_OTHER: Other issue

SHTDN_REASON_MAJOR_POWER: Power failure

SHTDN_REASON_MAJOR_SOFTWARE: Software issue

SHTDN_REASON_MAJOR_SYSTEM: System failure

Minor flags:

SHTDN_REASON_MINOR_BLUESCREEN: Blue screen crash event.

SHTDN_REASON_MINOR_CORDUNPLUGGED: Unplugged

SHTDN_REASON_MINOR_DISK: Disk

SHTDN_REASON_MINOR_ENVIRONMENT: Environment

SHTDN_REASON_MINOR_HARDWARE_DRIVER: Driver

SHTDN_REASON_MINOR_HOTFIX: Hot Fix

SHTDN_REASON_MINOR_HOTFIX_UNINSTALL: Hot fix uninstallation

SHTDN_REASON_MINOR_HUNG: Unresponsive

SHTDN_REASON_MINOR_INSTALLATION: Installation

SHTDN_REASON_MINOR_MAINTENANCE: Maintenance

SHTDN_REASON_MINOR_MMC: MMC issue

SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY: Network connectivity.

SHTDN_REASON_MINOR_NETWORKCARD: Network card

SHTDN_REASON_MINOR_OTHER: Other issue

SHTDN_REASON_MINOR_OTHERDRIVER: Other driver event

SHTDN_REASON_MINOR_POWER_SUPPLY: Power supply

SHTDN_REASON_MINOR_PROCESSOR: Processor

SHTDN_REASON_MINOR_RECONFIG: Reconfigure

SHTDN_REASON_MINOR_SECURITY: Secuity issue

SHTDN_REASON_MINOR_SECURITYFIX: Security patch

SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL: Security patch uninstallation

SHTDN_REASON_MINOR_SERVICEPACK: Service pack

SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL: Service pack uninstallation

SHTDN_REASON_MINOR_TERMSRV: Terminal services

SHTDN_REASON_MINOR_UNSTABLE: Unstable

SHTDN_REASON_MINOR_UPGRADE: Upgrade

SHTDN_REASON_MINOR_WMI: WMI issue

Additional flags (optional):

SHTDN_REASON_FLAG_USER_DEFINED: The reason code is defined by the user. If this flag is not present, the reason code is defined by the system

SHTDN_REASON_FLAG_PLANNED:The shutdown was planned. The system generates a System State Data (SSD) file. This file contains system state information such as the processes, threads, memory usage, and configuration.If this flag is not present, the shutdown was unplanned.Notification and reporting options are controlled by a set of policies.For example, after logging in, the system displays a dialog box reporting the unplanned shutdown if the policy has been enabled.An SSD file is created only if the SSD policy is enabled on the system

See https://msdn.microsoft.com/en-us/library/aa376885(v=vs.85).aspx

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WinUtils-1.1.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

WinUtils-1.1.2-cp37-cp37m-win32.whl (13.8 kB view details)

Uploaded CPython 3.7mWindows x86

File details

Details for the file WinUtils-1.1.2.tar.gz.

File metadata

  • Download URL: WinUtils-1.1.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for WinUtils-1.1.2.tar.gz
Algorithm Hash digest
SHA256 fdb9f0530286950219971c86e76b092f2cc814953602669d957a6fb70b1a302c
MD5 3d224211bef259bc75fcf69e86723b90
BLAKE2b-256 24dc3cb4ae2f54ce5660c2894a722caaa27a20deb41315aa4519f10ac2aa087b

See more details on using hashes here.

File details

Details for the file WinUtils-1.1.2-cp37-cp37m-win32.whl.

File metadata

File hashes

Hashes for WinUtils-1.1.2-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 2a5e6c979afdbc8a20635233c425263713861e7c32413620c32b732a1d87d342
MD5 420a552d8b2d7e32f3823e1009f263fa
BLAKE2b-256 b9001d6dd25d6c6e9783cdb7616af6ecd9317716d3644dd23a748fe591f73e4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page