Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

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


Release history Release notifications

This version
History Node

1.1.1

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
WinUtils-1.1.1-cp36-cp36m-win32.whl (13.8 kB) Copy SHA256 hash SHA256 Wheel cp36 Jun 14, 2018
WinUtils-1.1.1.tar.gz (4.1 kB) Copy SHA256 hash SHA256 Source None Jun 14, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page