1. The windows module¶
The windows module is the module installed by setup.py.
This module exports some objects representing the current state of the system.
It also offers some submodules aimed to help the interfacing with Windows and native code execution.
- The defaults objects accessible in
windowsare: systemof typewindows.winobject.system.Systemcurrent_processof typewindows.winobject.process.CurrentProcesscurrent_threadof typewindows.winobject.process.CurrentThread
- The submodules that you might use by themself are:
1.1. The system object¶
Note
See sample windows.system
- class windows.winobject.system.System[source]¶
Bases:
objectThe state of the current
WindowssystemPythonis running on- property bitness¶
The bitness of the system
- Type:
int– 32 or 64
- property build_number¶
Return the CurrentBuildNumber
- property computer_name¶
The name of the computer
- Type:
str
- property device_manager¶
An object to query the device&driver configured on the computer.
- Type:
- property display_version¶
Return the DisplayVersion (22H2, 23H2, …) is it exists, else None
- property environ¶
A unicode version of os.environ Same as os.environ on py3 Custom dict built on GetEnvironmentStringsW() on py2
- Type:
dict– {unicode:unicode}
- property etw¶
An object to interact with ETW (Event Tracing for Windows)
- Type:
- property event_log¶
An object to open Event channel/publisher and evtx file
- Type:
- property logicaldrives¶
List of logical drives [C:, …]
- Type:
[
LogicalDrive] – A list of LogicalDrive
- property modules¶
The list of system modules
- Type:
[
SystemModule] – A list ofSystemModuleorSystemModuleWow64
- network = <windows.winobject.network.Network object>¶
Object of class
windows.winobject.network.Network
- property object_manager¶
An object to query the objects in the kernel object manager.
- Type:
- property processes¶
The list of running processes
- Type:
[
WinProcess] – A list of Process
- property product_type¶
The product type, value might be:
VER_NT_WORKSTATION(0x1L)
VER_NT_DOMAIN_CONTROLLER(0x2L)
VER_NT_SERVER(0x3L)
- Type:
longorint(or subclass)
- registry = <windows.winobject.registry.Registry object>¶
Object of class
windows.winobject.registry.Registry
- property services¶
An object to query, list and explore services
- Type:
- property task_scheduler¶
An object able to manage scheduled tasks on the local system
- Type:
- property version¶
The version of the system
- Type:
(
int,int) – (Major, Minor)
- property version_name¶
The name of the system version, values are:
Windows Server 2025
Windows 11 Version 24H2
Windows 11 Version 23H2
Windows 11 Version 22H2
Windows 11 Version 21H2
Windows 10 Version 22H2
Windows 10 Version 21H2
Windows Server 2022
Windows 10 Version 21H1
Windows 10 Version 20H2
Windows 10 Version 2004
Windows 10 Version 1909
Windows 10 Version 1903
Windows Server 2019
Windows 10 Version 1809
Windows 10 Version 1803
Windows 10 Version 1709
Windows 10 Version 1703
Windows 10 Version 1607
Windows 10 Version 1511
Windows 10 Version 1507
Windows Server 2016
Windows Server 2012 R2
Windows 8.1
Windows Server 2012
Windows 8
Windows Server 2008
Windows 7
Windows Server 2008
Windows Vista
Windows XP Professional x64 Edition
Unknown: version (5.2) + is_workstation + bitness == 32 (don’t even know if possible..)
Windows Server 2003 R2
Windows Server 2003
Windows XP
Windows 2000
“Unknown Windows 10+ <versionstr={0} | is_workstation={1}>”.format(self.versionstr, is_workstation)
“Unknown Windows <version={0} | is_workstation={1}>”.format(version, is_workstation)
- Type:
unicode
- property wmi¶
An object to perform wmi requests to various namespaces
- Type: