You are here:
ActiveXperts.com > ActiveXperts Network Monitor > WindowsManagement > Scripts > Disks and File Systems > Page Files
Quicklinks
NOTE: ActiveXperts Network Monitor ships with a large collection of VBScript scripts to monitor any aspect of your network. Most VBScript scripts also have a PowerShell implementation. Download Now »
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPageFiles = objWMIService.ExecQuery _
("Select * from Win32_PageFileSetting")
For Each objPageFile in colPageFiles
objPageFile.InitialSize = 300
objPageFile.MaximumSize = 600
objPageFile.Put_
Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPageFiles = objWMIService.ExecQuery _
("Select * from Win32_PageFile")
For each objPageFile in colPageFiles
Wscript.Echo "CreationDate: " & vbTab & objPageFile.CreationDate
Wscript.Echo "Description: " & vbTab & objPageFile.Description
Wscript.Echo "Drive: " & vbTab & objPageFile.Drive
Wscript.Echo "FileName: " & vbTab & objPageFile.FileName
Wscript.Echo "FileSize: " & vbTab & objPageFile.FileSize
Wscript.Echo "InitialSize: " & vbTab & objPageFile.InitialSize
Wscript.Echo "InstallDate: " & vbTab & objPageFile.InstallDate
Wscript.Echo "MaximumSize: " & vbTab & objPageFile.MaximumSize
Wscript.Echo "Name: " & vbTab & objPageFile.Name
Wscript.Echo "Path: " & vbTab & objPageFile.Path
Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colPageFiles = objWMIService.ExecQuery _
("Select * from Win32_PageFileUsage")
For each objPageFile in colPageFiles
Wscript.Echo "AllocatedBaseSize: "& vbTab & objPageFile.AllocatedBaseSize
Wscript.Echo "CurrentUsage: "& vbTab & objPageFile.CurrentUsage
Wscript.Echo "Description: "& vbTab & objPageFile.Description
Wscript.Echo "InstallDate: "& vbTab & objPageFile.InstallDate
Wscript.Echo "Name: "& vbTab & objPageFile.Name
Wscript.Echo "PeakUsage: "& vbTab & objPageFile.PeakUsage
Next