Solved

getting registry size in wmi or vb

Posted on 2006-06-13
5
532 Views
Last Modified: 2012-06-27
Hey, I want to be able to get the registry size of a windows 2000 workstation. It would be cool if it could loop through and get a bunch of machine names.
0
Comment
Question by:tuckcorp
5 Comments
 
LVL 6

Expert Comment

by:Booda2us
ID: 16896959
1. In Control Panel, double-click System.  
2. On the Performance tab, click Change in the Virtual Memory section.  
3. In the Virtual Memory dialog box, in the Registry Size section, the current registry size and the maximum registry size are displayed.  I hope this helps you out...Booda2us
0
 

Author Comment

by:tuckcorp
ID: 16897021
Thanks, but I need a way to connect to a remote machine and get this info
0
 
LVL 9

Accepted Solution

by:
Krompton earned 500 total points
ID: 16897123
tuckcorp,
Try this...

Save this as a .vbs file
Change the (".",".") to ("computer01","computer2",etc...)

'********************
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array(".",".")
For Each strComputer In arrComputers
   Msg = Msg & VBCrLf & "Computer Registry Info for: " & strComputer

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Registry", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      Msg = Msg & VBCrLf & "CurrentSize: " & objItem.CurrentSize
      Msg = Msg & VBCrLf & "MaximumSize: " & objItem.MaximumSize
      Msg = Msg & VBCrLf & "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
      Msg = Msg & VBCrLf & "Name: " & objItem.Name
      Msg = Msg & VBCrLf & "Status: " & objItem.Status
      Msg = Msg & VBCrLf
      Msg = Msg & VBCrLf
   Next
Next
   WScript.Echo Msg


Function WMIDateStringToDate(dtmDate)
      WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
      Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
      & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

'********************
0
 
LVL 13

Expert Comment

by:haim96
ID: 16897189
there is a tool by microsoft named: DUREG.EXE
that check your registry size. you can download it free from
here :
https://www.microsoft.com/downloads/details.aspx?familyid=1562BCE1-A45E-4445-90A7-6E0342E5DC03&displaylang=en

about WMI , well i hope this one will work for you:
 '**********************************************+
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Registry",,48)

For Each objItem in colItems
   WScript.Echo "Caption: " & objItem.Caption
   WScript.Echo "CurrentSize: " & objItem.CurrentSize
   WScript.Echo "Description: " & objItem.Description
   WScript.Echo "InstallDate: " & objItem.InstallDate
   WScript.Echo "MaximumSize: " & objItem.MaximumSize
   WScript.Echo "Name: " & objItem.Name
   WScript.Echo "ProposedSize: " & objItem.ProposedSize
   WScript.Echo "Status: " & objItem.Status
   WScript.Echo ""
Next

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_UserInDomain",,48)

For Each objItem in colItems
   WScript.Echo "GroupComponent: " & objItem.GroupComponent
   WScript.Echo "PartComponent: " & objItem.PartComponent
   WScript.Echo ""
Next

'*******************************************************

it's from :
http://www.adminscripteditor.com/scriptlibrary/view.asp?id=351

0
 
LVL 9

Expert Comment

by:Krompton
ID: 16901709
BTW...

there are a number of very useful scripts available at
     http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx

You can also download the Scriptomatic(V2) tool and create basic scripts you can modify quickly (quickly :) depends on your scripting knowledge of course) to suit your needs. That's where I created the one in my previous post. Took about 2 min.

Cheers,
Krompton
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Often we come across situations wherein our batch files would be needing to reboot Windows for a variety of reasons. A few of them would be like: (1) Setup files have been updated whose changes can take effect only after a reboot …
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now