Most of the VBScript samples were created using Microsoft's
Scriptomatic
tool, the KiXtart scripts were my own "translations" of the VBScript versions,
most of the other scripts were generated by my
WMI Code generator.
The (XP) batch files use WMIC
(available in Windows XP Professional, Windows Server 2003 and Vista only).
Most, if not all, of these scripts can be used for any WMI enabled computer on the network.
Click the floppy disk icons to download the ZIPped sources
| WMI Examples | ||||
|---|---|---|---|---|
| Sources | Description | Last modified (DD/MM/YYYY) |
Remarks | |
| BattRun.bat | Display a warning message if a program is launched while the computer is running on battery power | 23/08/2007 | Uses WMIC | |
| BattStat.bat | Display battery status | 04/10/2006 | Uses WMIC | |
| BIOS.kix BIOS.orx BIOS.pl BIOS.ps1 BIOS.vbs |
Display BIOS information | 09/01/2003 11/09/2006 11/09/2006 11/09/2006 30/11/2002 |
||
| BootDisk.bat | Determine the boot disk, partition and drive letter | 26/10/2006 | Uses WMIC | |
| BootDriv.vbs | Return boot drive letter | 06/01/2003 | Created using script code found in TechNet Script Center: "Disks and File Systems" section (no longer available?) | |
| CDROM.kix CDROM.vbs |
Display all CD-ROM drive letters | 09/01/2003 16/11/2002 |
||
| CheckRes.vbs | Check if the screen resolution meets a specified minimum requirement, and exit with return code 1 if not | 31/05/2008 | ||
| COMPorts.vbs | Display serial ports information | 03/01/2003 | ||
| CPULoad.js CPULoad.vbs |
Display CPU load information | 07/02/2005 05/02/2005 |
||
| CPULoadTD.js CPULoadTD.vbs |
Display CPU load information in tab delimited format | 07/02/2005 05/02/2005 |
||
| CPUSpeed.vbs | Display CPU speed for each processor | 05/02/2005 | ||
| CPUSpeedTD.vbs | Display CPU speed for each processor in tab delimited format | 05/02/2005 | ||
| CPUType.vbs | Display CPU type | 05/02/2005 | ||
| CPUTypeTD.vbs | Display CPU type in tab delimited format | 05/02/2005 | ||
| DiskSpc.bat | Display harddisk summary for any WMI enabled computer or for a list of computers | 02/10/2006 | Uses WMIC | |
| DispEDID.vbs | Display the monitor's EDID asset information | 14/02/2007 | Based on a script by Michael Baird | |
| FreeSpace.vbs | Display a disk space summary | 12/10/2002 | ||
| GetPrint.vbs | List Print and PrintTo commands for all associated file types from the registry | 19/06/2008 | ||
| GetRAM.vbs | Display the amount of physical memory installed | 03/11/2002 | Based on WMI Scripting Primer: Part 1 by Greg Stemp, Dean Tsaltas and Bob Wells. | |
| GetRes.pl GetRes.ps1 GetRes.vbs |
Display Windows 2000's screen resolution and refresh rate | 11/09/2006 11/09/2006 09/01/2003 |
||
| GetRunDL.vbs | List all RUNDLL(32) commands for file associations from the registry | 01/01/2007 | ||
| GetSID.vbs | Display a user's Security ID | 03/12/2005 | ||
| Hardware.bat Hardware.hta Hardware.kix Hardware.vbs |
Display a basic hardware summary for any WMI enabled computer on the network | 03/10/2006
11/11/2006 01/01/2006 23/11/2002 |
The batch file uses WMIC. The HTA version automatically checks for updates. |
|
| HotFixes.vbs | Display installed hotfixes | 26/11/2002 | Based entirely on a (now no longer available) sample script from Microsoft TechNet Script Center | |
| HotFixesTD.vbs | Display installed hotfixes in tab delimited format | 26/11/2002 | Based entirely on a (now no longer available) sample script from Microsoft TechNet Script Center | |
| KillProg.vbs | Kill the specified program | 18/10/2002 | ||
| LastBoot.vbs | Display the last boot time | 09/12/2003 | ||
| Logoff.vbs | Logoff current user on any WMI enabled computer | 19/10/2002 | Adapted from posts by Alex K. Angelopoulos on Developersdex and Michael Harris on a VBScript newsgroup. | |
| MdmCmds.bat | Display the available configuration commands for your modem(s) | 12/10/2006 | Uses WMIC | |
| Memory.ps1 | Display a physical memory summary | 21/10/2006 | ||
| NICSpeed.kix NICSpeed.vbs |
Display ethernet adapter's link speed | 21/01/2006 06/01/2006 |
||
| PhysMem.vbs | Display a physical memory summary | 10/11/2002 | ||
| Processes.vbs | Display running processes | 17/10/2002 | ||
| PwdNoExp.bat | Set "password never expires" for a local account | 12/03/2008 | Uses WMIC | |
| ReadReg.vbs | Read a value from the registry | 06/04/2003 | Based on "Registry functions Provided by the WMI StdRegProv class" by Andrew Mayberry. | |
| Reboot.vbs | Reboot any WMI enabled computer on the network | 05/10/2002 | Based on a post by
Alex
K. Angelopoulos on
www.developersdex.com. See my Shutdown page for shutdown and reboot commands for "all" operating systems. |
|
| SAVVer.vbs | Display Symantec Antivirus program and definitions version | 29/06/2006 | ||
| Services.kix Services.vbs |
Display all services | 26/11/2002 02/11/2002 |
||
| ServicesTD.vbs | Display all services in TAB delimited format | 02/11/2002 | ||
| ShareMg2.vbs | Migrate all non-printer shares from one server to another | 02/11/2005 | Currently for Windows Server 2003, created migration script needs manual
modifications afterwards for Windows 2000. (For printer migration, use Microsoft's PrintMig; for Scheduled Tasks migration, copy the scheduled tasks -- %windir%\Tasks\*.job -- to the new server, and use JT.EXE to re-set the "Run as:" property for each migrated task.) |
|
| ShowCpuH.ps1 | Display CPU type, clock speed & load information in HTML | 01/09/2006 | ||
| ShowPRN.ps1 ShowPRN.vbs |
Display all installed printers and their properties | 10/09/2006 13/01/2004 |
||
| ShowPRNH.ps1 | Display all installed printers and their properties in HTML | 31/08/2006 | ||
| ShowPRNT.vbs | Display all installed printers and their properties in TAB delimited format | 17/01/2004 | ||
| Shutdown.vbs | Shut down any WMI enabled computer on the network | 05/10/2002 | Based on a post by
Alex
K. Angelopoulos on
www.developersdex.com. See my Shutdown page for shutdown and reboot commands for "all" operating systems. |
|
| Software.hta | List installed software | 17/01/2007 | Automatically checks for updates. | |
| SrvInv.vbs | Show and log a server hardware and software inventory | 14/09/2005 | ||
| Startup.vbs | Display all startup commands (Startup folder and registry Run) | 16/01/2003 | ||
| UpTime.vbs | Display uptime for any WMI enabled computer | 22/04/2006 | ||
| VBSNames.vbs | Demonstrates several VBScript techniques to retrieve user names, computer names & domain names | 22/01/2007 | Demo script from my VBScript scripting techniques section. | |
| VideoROM.kix VideoROM.vbs |
Display video adapter summary | 09/01/2003 01/12/2002 |
||
| WinVer.vbs | Display the Windows version | 26/07/2005 | ||
| WMIGen.hta | This HTA generates Batch, JScript, KiXtart, Object Rexx, Perl, PowerShell, Python and VBScript code for WMI queries | 20/10/2006 | Automatically checks for updates. Based on the example from the Microsoft TechNet ScriptCenter article Scripting Eye for the GUI Guy, with help from the Scripting Guys' Scriptomatic 2.0 and HTA Helpomatic tools and The Script Center Script Repository: Sample Windows PowerShell Scripts |
|