ABXZone Computer  Forums



Welcome to the ABXZone Computer Forums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Reply
 
LinkBack Thread Tools Display Modes
Old 04-26-2004, 06:43 PM   #1
.
 
Join Date: Feb 2001
Posts: 2,669
Cool! "Monitor Page File Use" script

Found it HERE.
copy and paste whats in the gray box to notepad and save as pf.vbs.. Double click on the file you saved and check it out.
Lots of cool stuff like this at the TechNet Script Center
Quote:
This page contains a list of sample scripts used to add, modify, enumerate, identify, and monitor disks and file systems in Windows 2000, Windows XP, and Windows Server 2003 (unless specified otherwise).

• Add a Disk Quota Entry

• Add a Volume Mount Point

• Add an Indexing Service Catalog

• Add an Indexing Service Scope

• Analyze Volume Defragmentation

• Associating Disk Partitions with Physical Disk Drives

• Bind to a Specific Disk Drive

• Change the Drive Letter of a Volume

• Change Volume Names

• Configure Disk Quota Settings

• Configure Page File Properties

• Configure the Indexing Service to Autostart

• Create a Dfs Node

• Defragment a Volume

• Delete a Disk Quota Entry

• Dismount a Volume

• Enable Disk Quotas

• Enabling Disk Quotas on the Local Computer

• Ensure that All Drives are Ready

• Enumerate Available Disk Space

• Enumerate Dfs Nodes

• Enumerate Dfs Targets

• Enumerate Disk Drive Properties Using FSO

• Enumerate Disk Partition Properties

• Enumerate Disk Quota Settings

• Enumerate Disk Quotas

• Enumerate Disk Space by User Using Disk Quotas

• Enumerate Floppy Drives

• Enumerate Indexing Service Catalogs

• Enumerate Indexing Service Scopes

• Enumerate Logical Disk Drive Properties

• Enumerate NTFS Properties

• Enumerate Page File Properties

• Enumerate Physical Disk Properties

• Enumerate Volume Mount Points

• Enumerate Volume Properties

• Enumerating CD-ROM Properties

• Enumerating Disk Quota Settings on the Local Computer

• Enumerating Disk Quotas on the Local Computer

• Enumerating Disk Space by User on the Local Computer

• Enumerating Floppy Disk Drive Properties

• Format a Volume

• Identify Drive Types

• Identify the File System Type

• Identify the Indexing Service State

• Modify a Disk Quota Entry

• Modify File System Properties

• Modify the AutoChk Timeout Value

• Monitor Logical Disk Drive Performance

• Monitor NTFS File Cache Performance

• Monitor Page File Use

• Monitor Physical Disk Drive Performance

• Monitor Volume Change Events

• Mount a Volume

• Pause the Indexing Service

• Prevent AutoChk From Running

• Query the Indexing Service for File Names

• Remove an Indexing Service Catalog

• Remove an Indexing Service Scope

• Resume the Indexing Service

• Retrieve Floppy Controller Information

• Retrieve IDE Controller Information

• Retrieve Information About Mapped Network Drives

• Retrieve IP4 Route Table Information

• Retrieve SCSI Controller Information

• Retrieve USB Controller Information

• Retrieve USB Hub Information

• Return a Disk Drive Collection

• Run ChkDsk

• Schedule AutoChk

• Search the Indexing Service

• Start the Indexing Service

• Stop the Indexing Service

• Use a Free Text Search with the Indexing Service

• Use a Predefined Indexing Service Query

• Verify ChkDsk Volume Status
(Offline)   Reply With Quote

 
Old 04-26-2004, 06:45 PM   #2
Registered User
 
keitaro-'s Avatar
 
Join Date: Nov 2003
Location: Vancouver
Posts: 376
nice link

thanks
__________________

Intel Pentium 4 1.6
Asus P4S333
512mb DDR SDRAM
WD600
WD2000JB
Sony DVD-Rom
LiteOn DVD-/+RW
Antec P160 Perfomace One Case
(Offline)   Reply With Quote
Old 04-26-2004, 07:13 PM   #3
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Coolio...neat!

I modified the script to put all info in one screen instead of a bunch consecutively.

Code:
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 &Chr(13)&Chr(10) _ 
    & "CurrentUsage: "& vbTab &  objPageFile.CurrentUsage &Chr(13)&Chr(10) _ 
    & "Description: "& vbTab &  objPageFile.Description	&Chr(13)&Chr(10) _ 
    & "InstallDate: "& vbTab &  objPageFile.InstallDate	&Chr(13)&Chr(10) _ 
    & "Name: "& vbTab &  objPageFile.Name	&Chr(13)&Chr(10) _ 
    & "PeakUsage: "& vbTab &  objPageFile.PeakUsage	 
Next
Do same as instructions above, but with this tweaked version.
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 07:21 PM   #4
.
 
Join Date: Feb 2001
Posts: 2,669
KT, YOU DA MAN!!!
(Offline)   Reply With Quote
Old 04-26-2004, 07:21 PM   #5
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Quote:
Originally posted by TweakHound
KT, YOU DA MAN!!!
Don't make me prove that...it's not pretty!
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 07:25 PM   #6
.
 
Join Date: Feb 2001
Posts: 2,669
Quote:
Originally posted by KingTermite
Don't make me prove that...it's not pretty!


Mods - I'd like to nominate KT's script as a sticky.
(Offline)   Reply With Quote
Old 04-26-2004, 07:27 PM   #7
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Quote:
Originally posted by TweakHound


Mods - I'd like to nominate KT's script as a sticky.
First, it's not MY script...I just destupified its presentation.

Second...instead of another sticky....things like this should go over in "articles" or "downloads" which NEVER get used and SHOULD! IMO anyway...
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 07:34 PM   #8
.
 
Join Date: Feb 2001
Posts: 2,669
You can submit it to the downloads section at http://www.abxzone.com/download.php?op=AddDownload .
Let me know if you need a server to put it on.
(Offline)   Reply With Quote
Old 04-26-2004, 07:35 PM   #9
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Why don't we just post it in the (already sticky) Coolest Utilities thead?
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 07:36 PM   #10
.
 
Join Date: Feb 2001
Posts: 2,669
p.s. - I have 3 page files, what should I change to display all 3 at once?
(Offline)   Reply With Quote
Old 04-26-2004, 07:40 PM   #11
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Quote:
Originally posted by TweakHound
p.s. - I have 3 page files, what should I change to display all 3 at once?
No idea...I don't know the object (or even vbscript for that matter)


But.....My educated guess is this:

For each objPageFile in colPageFiles
appears to be "trying" to display all page files...my guess is you would probably need to figure out some way of changing how "colPageFiles" was initialized.

It kind of looks like it *should* be doing this already....or else I don't know why he was doing a foreach loop in the first place.
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 07:47 PM   #12
.
 
Join Date: Feb 2001
Posts: 2,669
KT's Cool Page File Monitor

I'll play around with the code. Programming genius that I am.
(Offline)   Reply With Quote
Old 04-26-2004, 07:52 PM   #13
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Quote:
Originally posted by TweakHound
KT's Cool Page File Monitor

I'll play around with the code. Programming genius that I am.
The key would be to try to find documentation on those objects being used....it may have info in there.

If you find the doucmentation...PM it along, and maybe I'll play with it some time when I have a free few hours to tinker.
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 08:05 PM   #14
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Hehe....this was fun....

Here is another script to list all your network shares...I found it here:
http://www.activexperts.com/activmon...les/wmiremote/

Had to modify this one too.....

Code:
Option Explicit

ListShares()

Sub ListShares()
    Dim strObject
    Dim colShares
    Dim objWMIService, objShare
    Dim ShareNames

    Set objWMIService = GetObject( "winmgmts:" )
    Set colShares = objWMIService.ExecQuery( "Select * from Win32_Share" )
    
    For Each objShare In colShares
        ShareNames = ShareNames & objShare.Name & " [" & objShare.Path & "]" & Chr(13) & Chr(10)
    Next
    
    Wscript.Echo ShareNames
End Sub
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Old 04-26-2004, 08:32 PM   #15
The Shade of Lazarus
 
KingTermite's Avatar
 
Join Date: Jun 2002
Location: PM me to keep in contact
Posts: 26,003
Here was a page with more fun vbs (and perl) stuff:

http://www.tc.cornell.edu/services/e...ore.asp#Sec1.1

Taken from that page (as is, no modifications needed):


A sysinfo script.
Code:
'***************************************************************************
' 
' 10-07-01
' Simple VB Script to illustrate use of WMI to gather system information
' and display it in the same format at the Windows Management Console
'
'***************************************************************************
Set SystemSet = GetObject("winmgmts:").InstancesOf ("Win32_ComputerSystem")
for each System in SystemSet
	system_name = System.Caption 
        system_type = System.SystemType
	system_mftr = System.Manufacturer
	system_model = System.Model
next

Set ProcSet = GetObject("winmgmts:").InstancesOf ("Win32_Processor")
for each System in ProcSet
	proc_desc = System.Caption 
	proc_mftr = System.Manufacturer
	proc_mhz = System.CurrentClockSpeed
next

Set BiosSet = GetObject("winmgmts:").InstancesOf ("Win32_BIOS")
for each System in BiosSet
	bios_info = System.Version
next

Set ZoneSet = GetObject("winmgmts:").InstancesOf ("Win32_TimeZone")
for each System in ZoneSet
	loc_timezone = System.StandardName
next

Set OS_Set = GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
for each System in OS_Set
	os_name = System.Caption
        os_version = System.Version
	os_mftr = System.Manufacturer
	os_build = System.BuildNumber
	os_dir = System.WindowsDirectory
        os_locale = System.Locale
	os_totalmem = System.TotalVisibleMemorySize
	os_freemem = System.FreePhysicalMemory
        os_totalvirmem = System.TotalVirtualMemorySize
	os_freevirmem = System.FreeVirtualMemory
	os_pagefilesize = System.SizeStoredInPagingFiles
next

strResponseText = ("OS Name:  " & os_name & Chr(10))
strResponseText = strResponseText & ("Version:  " & os_version & " Build " & os_build & Chr(10))
strResponseText = strResponseText & ("OS Manufacturer:  " & os_mftr & Chr(10))
strResponseText = strResponseText & ("System Name:  " & system_name & Chr(10))
strResponseText = strResponseText & ("System Manufacturer:  " & system_mftr & Chr(10))
strResponseText = strResponseText & ("System Model:  " & system_model & Chr(10))
strResponseText = strResponseText & ("System Type:  " & system_type & Chr(10))
strResponseText = strResponseText & ("Processor:  " & proc_desc & " " & proc_mftr & " ~" & proc_mhz & "Mhz" & Chr(10))
strResponseText = strResponseText & ("BIOS Version:  " & bios_info & Chr(10))
strResponseText = strResponseText & ("Windows Directory:  " & os_dir & Chr(10))
strResponseText = strResponseText & ("Locale:  " & os_locale & Chr(10))  
strResponseText = strResponseText & ("Time Zone:  " & loc_timezone & Chr(10))
strResponseText = strResponseText & ("Total Physical Memory:  " & os_totalmem & "KB" & Chr(10))
strResponseText = strResponseText & ("Available Physical Memory:  " & os_freemem & "KB" & Chr(10))
strResponseText = strResponseText & ("Total Virtual Memory:  " & os_totalvirmem & "KB" & Chr(10))
strResponseText = strResponseText & ("Available Virtual Memory:  " & os_freevirmem & "KB" & Chr(10))
strResponseText = strResponseText & ("Page File Space : " & os_pagefilesize & "KB" & Chr(10))

MsgBox strResponseText, 0,"System Summary Information"
__________________

Bye Bye ABXZone.....Rest In Peace.
(Offline)   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.1
vBulletin Skin developed by: vBStyles.com

© 2006 - 2009 ABXZone Forums | About ABX Zone Forums | Advertising Opportunities | Legal | A member of the Crowdgather Forum Community