Function Repository Resource:

WindowsSystemData

Source Notebook

Get information from the current Windows system about running processes, hardware, security settings and more

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["WindowsSystemData"][alias]

returns a Dataset containing system information for alias.

ResourceFunction["WindowsSystemData"][alias,"property"]

returns a specific property.

ResourceFunction["WindowsSystemData"][alias,"property"value]

returns instances where "property" is equal to value.

ResourceFunction["WindowsSystemData"][alias,{propspec1,propspec2,}]

uses multiple properties and/or rules.

Details and Options

ResourceFunction["WindowsSystemData"] is a read-only interface to the WMIC utility.
ResourceFunction["WindowsSystemData"]["Properties"] returns a list of possible aliases.
Some typical aliases, along with their canonical WMIC names, are:
"BIOS"biosbasic input/output services (BIOS) information
"BootConfiguration"bootconfigboot configuration information
"CacheMemory"memcachecache memory information
"CDROM"cdromCD-ROM information
"ComputerSystem"computersystemcomputer system information
"CPU"cpuCPU information
"Desktop"desktopuser's desktop information
"DesktopMonitor"desktopmonitordesktop monitor information
"Directory"fsdirfilesystem directory entry information
"DiskDrive"diskdrivephysical disk drive information
"DiskQuota"diskquotadisk space usage for NTFS volumes
"Environment"environmentsystem environment settings
"Group"groupgroup account information
"HotfixInformation"qfehotfix information (quick-fix engineering)
"IDEController"idecontrollerIDE controller information
"IRQ"irqinterrupt request line (IRQ) information
"Job"jobprovides access to the jobs scheduled using the schedule service
"LoadOrder"loadorderinformation about system services that define execution dependencies
"LogicalDisk"logicaldisklogical storage device information
"Motherboard"baseboardmotherboard (baseboard) information
"NetClient"netclientnetwork client information
"NetLogin"netloginnetwork login information (of a particular user)
"NetProtocol"netprotocolprotocols (and their network characteristics) information
"NetUse"netuseactive network connection information
"NetworkInterfaceController"nicnetwork interface controller (NIC) information
"NetworkInterfaceControllerConfiguration"nicconfignetwork adapter information
"NTDomain"ntdomainNT domain information
"NTEvent"ntevententries in the NT event log
"OnboardDevice"onboarddeviceinformation about devices built into the motherboard
"OperatingSystem"osinstalled operating system(s) information
"PageFile"pagefilevirtual memory file-swapping information
"PageFileSet"pagefilesetpage file settings information
"Partition"partitioninformation about partitioned areas of a physical disk
"PhysicalMemory"memphysicalcomputer system's physical memory information
"Printer"printerprinter device information
"PrintJob"printjobprint job information
"Process"processprocess information
"Product"productinstallation package task information
"Properties"propertiesget a list of valid aliases
"QuotaSetting"quotasettingsetting information for disk quotas on a volume
"Registry"registrycomputer system registry information
"SCSIController"scsicontrollerSCSI controller information
"Server"serverserver information
"Service"serviceservice application information
"Share"shareshared resource information
"SoundDevice"sounddevsound device information
"StartUp"startupinformation about commands that run automatically at startup
"SystemAccount"sysaccountsystem account information
"SystemDriver"sysdriverinformation about the system driver for a base service
"SystemEnclosure"systemenclosurephysical system enclosure information
"SystemRecoverySettings"recoverosinformation that will be gathered when the operating system fails
"SystemSlot"systemslotinformation about ports, slots and peripherals
"TapeDrive"tapedrivetape drive information
"TimeZone"timezonetime zone data information
"UserAccount"useraccountuser account information

Examples

Basic Examples (4) 

Get information about the operating system:

In[1]:=
ResourceFunction["WindowsSystemData"]["OperatingSystem"]
Out[1]=

Get a specific set of properties of the CPU:

In[2]:=
ResourceFunction[
 "WindowsSystemData"]["CPU", {"Name", "CurrentClockSpeed", "LoadPercentage", "NumberOfLogicalProcessors", "L2CacheSize", "L3CacheSize"}]
Out[2]=

Get information about the current kernel process:

In[3]:=
ResourceFunction["WindowsSystemData"]["Process", "ProcessID" -> $ProcessID]
Out[3]=

Get a list of possible properties:

In[4]:=
ResourceFunction["WindowsSystemData"]["Properties"]
Out[4]=

Scope (4) 

Get values for system environment variables:

In[5]:=
ResourceFunction[
 "WindowsSystemData"]["Environment", {"Name", "VariableValue", "SystemVariable" -> True}]
Out[5]=

View properties about installed applications:

In[6]:=
Select[ResourceFunction["WindowsSystemData"][
  "Product"], #Vendor === "Wolfram Research, Inc." &]
Out[6]=

Get information about a directory:

In[7]:=
ResourceFunction["WindowsSystemData"]["DirectoryInformation", "Name" -> $InstallationDirectory]
Out[7]=

Check the status of device drivers:

In[8]:=
Select[ResourceFunction["WindowsSystemData"][
  "SystemDriver", {"Description", "State"}], StringContainsQ[#Description, "bluetooth", IgnoreCase -> True] &]
Out[8]=

Applications (1) 

Track how much data is written to disk during an evaluation:

In[9]:=
trackDiskWrites // Attributes = {HoldFirst};
trackDiskWrites[eval_] :=
  Module[{start, result, end},
   start = ResourceFunction["WindowsSystemData"][
     "Process", {"ProcessId" -> $ProcessID, "WriteTransferCount"}];
   result = eval;
   end = ResourceFunction["WindowsSystemData"][
     "Process", {"ProcessId" -> $ProcessID, "WriteTransferCount"}];
   {end - start, result}
   ];
In[10]:=
bytes = ByteArray[RandomInteger[255, 10^7]]
Out[10]=
In[11]:=
trackDiskWrites[Export[CreateFile[], bytes, "Binary"]]
Out[11]=
In[12]:=
DeleteFile[Last[%]]

Neat Examples (1) 

Create a dynamic status monitor that shows CPU and memory usage:

In[13]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/2fdd3e8b-c8ff-4385-b151-005de3facd03"]
Out[14]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 21 February 2019

Related Resources

License Information