Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

getting registry size in wmi or vb

Posted on 2006-06-13
5
Medium Priority
?
554 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello I read in a discussion about a person who configured a very simple mirror RAID with two hard drives; the system and data were on the same partition. He asked how to repair the system as it was not booting up anymore. In his case running …
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

886 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