Enumerating Environment variables
One of the way to enumerate the Environment Variables is by accessing _environ global variable. The GetEnvironmentStrings function provides another way by returning a pointer to the environment block of the calling process. It can also be done using WMI Win32_Environment Class.
Get number of jobs in print queue
The number of jobs in print queue can be retrieved by simplified version of Enumerating jobs in print queue
Enumerating jobs in print queue
Enumerating jobs in a print queue can be done with
- WMI Win32_PrintJob class
- Windows API EnumJobs function.
How to delete all Print Jobs from a print queue
All jobs from a print queue can be deleted with
- WMI Win32_Printer class and CancelAllJobs method
- Windows API SetPrinter function.
Check if EXE is running and optionally terminate it
The WMI Win32_Process class
represents a process on an operating system.