Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find memory information on registry

Status
Not open for further replies.

y3by

Programmer
Jan 15, 2002
92
PT
hi ppl,

i'm trying to develop a script to find machines that have more then XXX MB of memory...

for the processor i've found a key "~MHZ" in HKLM\HARWARE\description\system\CentralProcessor\0

but for the memory i can't find any key...
i use a lan monitor and registry field i get the information... then i thougth " if the program can get that information from registry, i could get it too..." but until now i can't :(

can any of you help me !?!?
thks
 
Something a friend sent me. It does more than just memory. It wrote the information to a path on the network when the script was run on the client. Warning: vb script contained in this message. start script:

' ---- Debugging and error handling
Dim strDebug
strDebug = "off"

if strDebug = "on" then
On Error Goto 0
else
On Error Resume Next
end if

If Err > 1 then
MsgBox ("Error # " & CStr(Err.Number) & " " & Err.Description & Chr(13) & "Close this message to continue.")
Err.Clear ' Clear the error
end if

' -- Script timer for performance assesment
Dim intStart
intStart = Timer

Dim WSHShell, WSHNetwork, strUserName, strComputerName, CRLF, strf2, strf3
Dim fso, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10
Set WSHShell=WScript.CreateObject("WScript.Shell")
Set WSHNetwork = WScript.CreateObject("WScript.Network")
strUserName = UCase(WSHNetwork.UserName)
if Len(Trim(strUserName)) < 1 then
strUserName = WSHShell.RegRead(&quot;HKLM\System\Current Control Set\Control\Current User&quot;)
end if
strComputerName = WSHNetwork.ComputerName
CRLF = Chr(13) & CHR(10)

' -- Administrator supplied variables
Dim strDomain, strUDrive, strUShare, strUPath, strDPath
strDomain = &quot;Domain-A&quot;
strUDrive = &quot;I:&quot;
strUShare = &quot;\\usnas1\users&quot;
strUPath = strUdrive & &quot;\&quot; & strUserName & &quot;\_IT\&quot;
strDPath = &quot;\\usnts5\asset$\&quot;

strCheck = &quot;No&quot;
Set oDrives = WshNetwork.EnumNetworkDrives
For i = 0 to oDrives.Count -1
if UCase(Left(oDrives.Item(i), 2)) = strUDrive then strCheck = &quot;Yes&quot;
Next
if strCheck = &quot;No&quot; then WSHNetwork.MapNetworkDrive strUDrive, strUShare

Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
' -- Create folder for machine and user
FolderCreate(strDPath & strComputerName)
FolderCreate(strUPath)

' ---------- Run Asset Sub-routines
' Must run BaseInfo
if fso.FileExists(strDPath & &quot;\&quot; & strComputerName & &quot;\user.txt&quot;) then
BaseInfo
Processor
MemorySlots
' VideoAdapter
Storage
' IO
NIC
' Drives
' UserOS
' UserDesktop
' InstalledPrinters
Finish
else
BaseInfo
Processor
MemorySlots
VideoAdapter
Storage
IO
NIC
Drives
UserOS
UserDesktop
InstalledPrinters
Finish
end if


' ===========================================================================
' Asset Sub-Routines
' ===========================================================================
' ----------- User information
sub BaseInfo
Set f1 = fso.CreateTextFile(strUPath & strComputerName & &quot;.txt&quot;, True)
Set objADNet = GetObject(&quot;WinNT://&quot; & strDomain & &quot;/&quot; & strUserName & &quot;,user&quot;)

' -- USER.TXT - ComputerName;UserName;FullName;Description
f1.WriteLine &quot;Computer: &quot; & strComputerName
f1.WriteLine &quot;User Name: &quot; & objADNet.Name
f1.WriteLine &quot;Full Name: &quot; & objADNet.FullName
f1.WriteLine &quot;Description: &quot; & objADNet.Description
strf2 = strComputerName & &quot;;&quot; & strUserName & &quot;;&quot; & objADNet.FullName & &quot;;&quot; & objADNet.Description
Set objADNet = Nothing

' ----------- System information
' -- SYSTEM.TXT - ComputerName;Description;Manufacturer;Model;BIOS;BIOSVersion;SMBIOSVersion;SystemType
f1.WriteLine &quot;----- System&quot;
Set BIOSSet = GetObject(&quot;winmgmts:&quot;).ExecQuery (&quot;select * from Win32_BIOS where PrimaryBIOS=true&quot;)
For Each BIOS in BIOSSet
strBIOS = Trim(BIOS.Description)
strBIOSVerison = BIOS.Version
if BIOS.SMBIOSPresent = true then
strSMBIOSVersion = BIOS.SMBIOSBIOSVersion
else
strSMBIOSVersion = &quot;SMBIOS not installed.&quot;
end if
Next
Set BIOSSet = Nothing

Set SystemSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_ComputerSystem&quot;)
For Each System in SystemSet
f1.WriteLine &quot;Description: &quot; & System.Description
f1.WriteLine &quot;Manufacturer: &quot; & System.Manufacturer
f1.WriteLine &quot;Model: &quot; & System.Model
f1.WriteLine &quot;BIOS: &quot; & strBIOS
f1.WriteLine &quot;Version: &quot; & strBIOSVersion
f1.WriteLine &quot;SMBIOS: &quot; & strSMBIOSVersion
f1.WriteLine &quot;Owner: &quot; & System.PrimaryOwnerName
f1.WriteLine &quot;System Type: &quot; & System.SystemType
f1.WriteLine &quot;Memory: &quot; & Round((System.TotalPhysicalMemory+655360)/1048576,0) & &quot;Mb&quot;
strf3 = strComputerName & &quot;;&quot; & Trim(System.Description) & &quot;;&quot; & Trim(System.Manufacturer) &_
&quot;;&quot; & Trim(System.Model) & &quot;;&quot; & strBIOS & &quot;;&quot; & strBIOSVersion & &quot;;&quot; & strSMBIOSVersion &_
&quot;;&quot; & System.SystemType
Next
Set SystemSet = Nothing
end sub ' BaseInfo

' ----------- Processor information
sub Processor
' -- CPU.TXT - ComputerName;CPUClock;CPUName;Description;SlotType
Set f4 = fso.CreateTextFile(strDPath & strComputerName & &quot;\CPU.txt&quot;, True)
f1.WriteLine &quot;----- Processor(s)&quot;
Set CPUSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_Processor&quot;)
f1.WriteLine &quot;Nmbr Proc: &quot; & CPUSet.Count
For Each CPU in CPUSet
f1.WriteLine &quot;CPU Speed: &quot; & CPU.CurrentClockSpeed & &quot; MHz&quot;
f1.WriteLine &quot;CPU Name: &quot; & CPU.Name
f1.WriteLine &quot;Description: &quot; & CPU.Description
f1.WriteLine &quot;Slot Type: &quot; & ShowMethod(CPU.UpgradeMethod)
f4.WriteLine strComputerName & &quot;;&quot; & CPU.CurrentClockSpeed & &quot;;&quot; & Trim(CPU.Name) &_
&quot;;&quot; & Trim(CPU.Description) & &quot;;&quot; & ShowMethod(CPU.UpgradeMethod)
Next
Set CPUSet = Nothing
f4.Close
Set f4 = Nothing
end sub ' Processor

' ----------- Memory information
sub MemorySlots
' -- MEMORY.TXT - ComputerName;Bank;Size;SlotType;MemoryType
' -- SYSTEM.TXT - Append ;Memory
f1.WriteLine &quot;----- Memory&quot;
Set f5 = fso.CreateTextFile(strDPath & strComputerName & &quot;\Memory.txt&quot;, True)
Set MemorySet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_PhysicalMemory&quot;)
Dim intMemTotal
intMemTotal = 0
For Each Memory in MemorySet
f1.WriteLine &quot;Bank: &quot; & Memory.BankLabel
f1.WriteLine &quot;Size: &quot; & Round(Memory.Capacity/1048576,0) & &quot;Mb &quot; & ShowMemorySlotType(Memory.FormFactor)
if (Memory.TotalWidth - Memory.DataWidth) > 0 then
f1.WriteLine &quot;Type: &quot; & ShowMemoryType(Memory.MemoryType) & &quot;, ECC&quot;
f5.WriteLine strComputerName & &quot;;&quot; & Memory.BankLabel & &quot;;&quot; & Memory.Capacity &_
&quot;;&quot; & ShowMemorySlotType(Memory.FormFactor) & &quot;;&quot; & ShowMemoryType(Memory.MemoryType) & &quot;, ECC&quot;
else
f1.WriteLine &quot;Type: &quot; & ShowMemoryType(Memory.MemoryType)
f5.WriteLine strComputerName & &quot;;&quot; & Memory.BankLabel & &quot;;&quot; & Memory.Capacity &_
&quot;;&quot; & ShowMemorySlotType(Memory.FormFactor) & &quot;;&quot; & ShowMemoryType(Memory.MemoryType)
end if
intMemTotal = intMemTotal + Memory.Capacity
Next
strf3 = strf3 & &quot;;&quot; & intMemTotal
Set CPUSet = Nothing
f5.Close
Set f5 = Nothing
end sub ' MemorySlots

' ----------- Video Controller information
sub VideoAdapter
' -- VIDEO.TXT - append ;VideoAdapter;VideoRAM;Resolution
Set f11 = fso.CreateTextFile(strDPath & strComputerName & &quot;\Video.txt&quot;, True)
f1.WriteLine &quot;----- Display Adapter&quot;
Set VideoSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_VideoController&quot;)
For Each Video in VideoSet
f1.WriteLine &quot;Description: &quot; & Video.Description
f1.WriteLine &quot;Memory: &quot; & Video.AdapterRam
f1.WriteLine &quot;Resolution: &quot; & Video.VideoModeDescription
f11.WriteLine strComputerName & &quot;;&quot; & Trim(Video.Description) & &quot;;&quot; & Video.AdapterRam & &quot;;&quot; & Video.VideoModeDescription
Next
Set VideoSet = Nothing
f11.Close
Set f11 = Nothing
end sub 'VideoAdapter

' ----------- Storage Device information
sub Storage
' -- STORAGE.TXT - ComputerName;Description;Manufacturer;Interface;Capacity;Partitions
f1.WriteLine &quot;----- Storage&quot;
Set f6 = fso.CreateTextFile(strDPath & strComputerName & &quot;\Storage.txt&quot;, True)
Set FloppySet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_FloppyDrive&quot;)
if FloppySet.Count = 0 then
f1.WriteLine &quot;Description: FDD not detected&quot;
f6.WriteLine strComputerName & &quot;;&quot; & &quot;FDD not detected;;;;&quot;
else
For Each Floppy in FloppySet
f1.WriteLine &quot;Description: &quot; & Floppy.Description
f1.WriteLine &quot;Manufacturer: &quot; & Floppy.Manufacturer
f1.WriteLine &quot;Name: &quot; & Floppy.Name
f6.WriteLine strComputerName & &quot;;&quot; & Trim(Floppy.Description) & &quot;;&quot; & Trim(Floppy.Manufacturer) & &quot;;FDD Controller;;&quot;
Next
end if
Set FloppySet = Nothing

Set DiskSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_DiskDrive&quot;)
For Each Disk in DiskSet
f1.WriteLine &quot;Description: &quot; & Disk.Description
f1.WriteLine &quot;Manufacturer: &quot; & Disk.Manufacturer
if Disk.InterfaceType = &quot;SCSI&quot; then
f1.WriteLine &quot;Interface: SCSI ID-&quot; & Disk.SCSITargetId
strInterface = &quot;SCSI ID-&quot; & Disk.SCSITargetId
else
f1.WriteLine &quot;Interface: &quot; & Disk.InterfaceType
strInterface = Disk.InterfaceType
end if
if Not IsNull(Disk.Size) then
f1.WriteLine &quot;Size: &quot; & Round(Disk.Size/1048576,2) & &quot; Mb&quot;
f1.WriteLine &quot;Partitions: &quot; & Disk.Partitions
end if
f6.WriteLine strComputerName & &quot;;&quot; & Trim(Disk.Description) & &quot;;&quot; & Trim(Disk.Manufacturer) &_
&quot;;&quot; & strInterface & &quot;;&quot; & Disk.Size & &quot;;&quot; & Disk.Partitions
Next
Set DiskSet = Nothing

Set CDROMSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_CDROMDrive&quot;)
if CDROMSet.Count = 0 then
f1.WriteLine &quot;Description: CD-ROM not detected&quot;
f6.WriteLine strComputerName & &quot;;&quot; & &quot;CD-ROM not detected;;;;&quot;
else
Dim strCD, strCDInterface
For Each CDROM in CDROMSet
if CDROM.Description = &quot;CD-ROM Drive&quot; then
strCD = Trim(CDROM.Caption)
f1.WriteLine &quot;Description: &quot; & CDROM.Caption
else
strCD = Trim(CDROM.Description)
f1.WriteLine &quot;Description: &quot; & CDROM.Description
end if
f1.WriteLine &quot;Manufacturer: &quot; & CDROM.Manufacturer
if CDROM.SCSITargetId > 0 then
strCDInterface = &quot;SCSI, ID-&quot; & CDROM.SCSITargetId
f1.WriteLine &quot;Interface: SCSI, ID-&quot; & CDROM.SCSITargetId
else
strCDInterface = &quot;IDE&quot;
f1.WriteLine &quot;Interface: IDE&quot;
end if
f6.WriteLine strComputerName & &quot;;&quot; & strCD & &quot;;&quot; & Trim(CDROM.Manufacturer) & &quot;;&quot; & strCDInterface & &quot;;;&quot;
Next
end if
Set CDROMSet = Nothing
f6.Close
Set f6 = Nothing
end sub ' Storage

' ----------- Input/Output information
sub IO
' -- IO.TXT - ComputerName;Description;Type
Set f7 = fso.CreateTextFile(strDPath & strComputerName & &quot;\IO.txt&quot;, True)
f1.WriteLine &quot;----- Input/Output&quot;
Set KBSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_Keyboard&quot;)
For Each KB in KBSet
f1.WriteLine &quot;Device: &quot; & KB.Description
f1.WriteLine &quot;Type: &quot; & KB.Layout
f7.WriteLine strComputerName & &quot;;&quot; & Trim(KB.Description) & &quot;;&quot; & KB.Layout
Next
Set KBSet = Nothing

Set MouseSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_PointingDevice&quot;)
if MouseSet.Count = 0 then
f1.WriteLine &quot;Device: Pointing device not detected&quot;
f1.WriteLine &quot;Type:&quot;
f7.WriteLine strComputerName & &quot;;Pointing device not detected;&quot;
else
For Each Mouse in MouseSet
f1.WriteLine &quot;Device: &quot; & Mouse.Description
f1.WriteLine &quot;Type: &quot; & ShowPointingDeviceType(Mouse.PointingType)
f7.WriteLine strComputerName & &quot;;&quot; & Trim(Mouse.Description) & &quot;;&quot; & ShowPointingDeviceType(Mouse.PointingType)
Next
end if
Set USBSet = Nothing

Set LPTSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_ParallelPort&quot;)
if LPTSet.Count = 0 then
f1.WriteLine &quot;Device: Parallel Port not detected&quot;
f1.WriteLine &quot;Type:&quot;
f7.WriteLine strComputerName & &quot;;Parallel Port not detected;&quot;
else
For Each LPT in LPTSet
f1.WriteLine &quot;Device: &quot; & LPT.Description
f1.WriteLine &quot;Type: &quot; & ShowProtocolType(LPT.ProtocolSupported)
f7.WriteLine strComputerName & &quot;;&quot; & Trim(LPT.Description) & &quot;;&quot; & ShowProtocolType(LPT.ProtocolSupported)
Next
end if
Set LPTSet = Nothing

Set COMSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_SerialPort&quot;)
if COMSet.Count = 0 then
f1.WriteLine &quot;Device: Serial Port not detected&quot;
f1.WriteLine &quot;Type:&quot;
f7.WriteLine strComputerName & &quot;;Serial Port not detected;&quot;
else
For Each COM in COMSet
8 strCom = COM.ProviderType
if strCom <> &quot;&quot; then
f1.WriteLine &quot;Device: &quot; & COM.Description
f1.WriteLine &quot;Type: &quot; & strCOM
f7.WriteLine strComputerName & &quot;;&quot; & Trim(COM.Description) & &quot;;&quot; & strCOM
end if
Next
end if
Set COMSet = Nothing

Set ModemSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_POTSModem&quot;)
if ModemSet.Count > 0 then
For Each Modem in ModemSet
f1.WriteLine &quot;Device: &quot; & Modem.AttachedTo
f1.WriteLine &quot;Type: &quot; & Modem.ProviderName & &quot;, &quot; & Modem.Name
f7.WriteLine strComputerName & &quot;;&quot; & Modem.AttachedTo & &quot;;&quot; & Trim(Modem.Name)
Next
end if
Set COMSet = Nothing

Set USBSet = GetObject(&quot;winmgmts:&quot;).InstancesOf(&quot;Win32_USBController&quot;)
if USBSet.Count = 0 then
f1.WriteLine &quot;Device: USB not detected&quot;
f1.WriteLine &quot;Type:&quot;
f7.WriteLine strComputerName & &quot;;USB not detected;&quot;
else
For Each USB in USBSet
f1.WriteLine &quot;Device: &quot; & USB.Description
f1.WriteLine &quot;Type: &quot; & ShowProtocolType(USB.ProtocolSupported)
f7.WriteLine strComputerName & &quot;;&quot; & Trim(USB.Description) & &quot;;&quot; & ShowProtocolType(USB.ProtocolSupported)
Next
end if
Set USBSet = Nothing
f7.Close
Set f7 = Nothing
end Sub ' IO

' ----------- Adapter information
sub NIC
' -- NIC.TXT - ComputerName;Adapter;MACAddress;DHCP;IPAddress;SubnetMask;Gateway;DNS;WINS
Set f8 = fso.CreateTextFile(strDPath & strComputerName & &quot;\NIC.txt&quot;, True)
f1.WriteLine &quot;----- Network&quot;
Set AdapterSet = GetObject(&quot;winmgmts:&quot;).ExecQuery(&quot;select * from Win32_NetworkAdapterConfiguration where IPEnabled=true&quot;)
for each Adapter in AdapterSet
strIPAddress = &quot;&quot;
strIPAddress = Adapter.IPAddress(0)
if strIPAddress <> &quot;&quot; then
f1.WriteLine &quot;Adapter: &quot; & Adapter.Description
f1.WriteLine &quot;MAC: &quot; & Adapter.MACAddress
if Adapter.DHCPEnabled = true then
f1.WriteLine &quot;DHCP Enabled&quot;
strDHCP = &quot;Enabled&quot;
else
f1.WriteLine &quot;DHCP Disabled&quot;
strDHCP = &quot;Disabled&quot;
end if
f1.WriteLine &quot;IP: &quot; & Adapter.IPAddress(0)
f1.WriteLine &quot;SM: &quot; & Adapter.IPSubnet(0)
f1.WriteLine &quot;GW: &quot; & Adapter.DefaultIPGateway(0)
f1.WriteLine &quot;DNS: &quot; & Adapter.DNSServerSearchOrder(0)
f1.WriteLine &quot;WINS: &quot; & Adapter.WINSPrimaryServer(0) & &quot; &quot; & Adapter.WINSSecondaryServer(0)
f8.WriteLine strComputerName & &quot;;&quot; & Trim(Adapter.Description) & &quot;;&quot; & Adapter.MACAddress & &quot;;&quot; & strDHCP &_
&quot;;&quot; & Adapter.IPAddress(0) & &quot;;&quot; & Adapter.IPSubnet(0) & &quot;;&quot; & Adapter.DefaultIPGateway(0) &_
&quot;;&quot; & Adapter.DNSServerSearchOrder(0) & &quot;;&quot; & Adapter.WINSPrimaryServer(0)
end if
next
Set AdapterSet = Nothing
f8.Close
Set f8 = Nothing
end sub ' NIC

' -------- Get logical disk information
sub Drives
' -- DRIVES.TXT - ComputerName;DeviceID;Description;FileSystem;Size;FreeSpace
f1.WriteLine &quot;----- Disk Drives&quot;
Set f9 = fso.CreateTextFile(strDPath & strComputerName & &quot;\Drives.txt&quot;, True)
Set DiskSet = GetObject(&quot;winmgmts:&quot;).InstancesOf (&quot;Win32_LogicalDisk&quot;)
for each Disk in DiskSet
if Not Disk.DriveType = 4 then
f1.WriteLine Disk.DeviceID & &quot; &quot; & Disk.Description
f1.WriteLine &quot;&quot; & Disk.FileSystem
if Not IsNull(Disk.Size) then
f1.WriteLine Round(Disk.Size/1048576,2) & &quot;Mb total &quot; & Round(Disk.FreeSpace/1048576,2) & &quot;Mb free&quot;
end if
f9.WriteLine strComputerName & &quot;;&quot; & Disk.DeviceID & &quot;;&quot; & Disk.Description & &quot;;&quot; & Disk.FileSystem &_
&quot;;&quot; & Disk.Size & &quot;;&quot; & Disk.FreeSpace
else
f9.WriteLine strComputerName & &quot;;&quot; & Disk.DeviceID & &quot;;&quot; & Disk.ProviderName & &quot;;&quot; & Disk.FileSystem &_
&quot;;&quot; & Disk.Size & &quot;;&quot; & Disk.FreeSpace
end if
next
Set DiskSet = Nothing
f9.Close
Set f9 = Nothing
end sub ' Drives

' -------- Operating system
sub UserOS
' -- USER.TXT - append ;OS;Version;PatchLevel;SerialNo;WinDir
f1.WriteLine &quot;----- Operating System&quot;
Set OSSet = GetObject(&quot;winmgmts:&quot;).InstancesOf (&quot;Win32_OperatingSystem&quot;)
for each OS in OSSet
f1.WriteLine &quot;Operating System: &quot; & OS.Caption
f1.WriteLine &quot;Version: &quot; & OS.Version
f1.WriteLine &quot;Patch Level: &quot; & OS.CSDVersion
f1.WriteLine &quot;Serial Number: &quot; & OS.SerialNumber
f1.WriteLine &quot;Windows Directory: &quot; & OS.WindowsDirectory
strf2 = strf2 & &quot;;&quot; & OS.Caption & &quot;;&quot; & OS.Version & &quot;;&quot; & OS.CSDVersion & &quot;;&quot; & OS.SerialNumber &_
&quot;;&quot; & OS.WindowsDirectory
next
Set OSSet = Nothing
end sub ' UserOS

' -------- Desktop
sub UserDesktop
' -- USER.TXT - append ;ScreenSaver;SSFile;SSSecured;Wallpaper
f1.WriteLine &quot;----- Desktop&quot;
Set DeskTopSet = GetObject(&quot;winmgmts:&quot;).InstancesOf (&quot;Win32_Desktop&quot;)
For each Desktop in DesktopSet
if UCase(Desktop.Name) = UCase(strDomain & &quot;\&quot; & strUserName) then
f1.WriteLine &quot;Screen Saver: &quot; & Desktop.ScreenSaverActive
f1.WriteLine &quot;File: &quot; & Desktop.ScreenSaverExecutable
f1.WriteLine &quot;Secured: &quot; & Desktop.ScreenSaverSecure
f1.WriteLine &quot;Wallpaper: &quot; & Desktop.Wallpaper
strf2 = strf2 & &quot;;&quot; & Desktop.ScreenSaverActive & &quot;;&quot; & Desktop.ScreenSaverExecutable &_
&quot;;&quot; & Desktop.ScreenSaverSecure & &quot;;&quot; & Desktop.Wallpaper
end if
Next
Set DesktopSet = Nothing
end sub ' UserDesktop

' -------- Printers
sub InstalledPrinters
' -- PRINTER.TXT - ComputerName;PrinterName;Driver;Resolution
f1.WriteLine &quot;----- Printers&quot;
Set f10 = fso.CreateTextFile(strDPath & strComputerName & &quot;\Printer.txt&quot;, True)
Set PrinterSet = GetObject(&quot;winmgmts:&quot;).InstancesOf (&quot;Win32_Printer&quot;)
If (PrinterSet.Count = 0 ) Then
f1.WriteLine &quot;No printers installed&quot;
f10.WriteLine strComputerName & &quot;;&quot; & &quot;No printers installed;;&quot;
else
for each Printer in PrinterSet
strIPAddress = &quot;&quot;
strIPAddress = WSHShell.RegRead(&quot;HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\HP JetDirect Port\Ports\&quot; & Printer.PortName & &quot;\HPNetworkPrinterID&quot;)
if strIPAddress <> &quot;&quot; then
strIPAddress = Replace(strIPAddress, &quot;TCPIP,&quot;, &quot;&quot;)
strIPAddress = Replace(strIPAddress, &quot;,0&quot;, &quot;&quot;)
else
strIPAddress = WSHShell.RegRead(&quot;HKLM\SYSTEM\CurrentControlSet\Control\Print\Monitors\LPR Port\Ports\&quot; & Printer.PortName & &quot;\Server Name&quot;)
end if
f1.WriteLine &quot;---------------------------------------------&quot;
f1.WriteLine &quot; Printer: &quot; & Printer.Name
f1.WriteLine &quot; Port Name: &quot; & Printer.PortName
f1.WriteLine &quot; IP Address: &quot; & strIPAddress
f1.WriteLine &quot; Share Name: &quot; & Printer.ShareName
f1.WriteLine &quot; Location: &quot; & Printer.Location
f1.WriteLine &quot;Description: &quot; & WSHShell.RegRead(&quot;HKLM\SYSTEM\CurrentControlSet\Control\Print\Printers\&quot; & Printer.PortName & &quot;\Description&quot;)
f1.WriteLine &quot; Driver: &quot; & Printer.DriverName
f1.WriteLine &quot; Resolution: &quot; & Printer.HorizontalResolution & &quot; dpi&quot;
f10.WriteLine strComputerName & &quot;;&quot; & Printer.Name & &quot;;&quot; & Printer.DriverName &_
&quot;;&quot; & Printer.HorizontalResolution
next
end if
Set PrinterSet = Nothing
f10.Close
Set f10 = Nothing
end sub ' InstalledPrinters

' --------- Close the files
sub Finish
f1.Close ' Computer_Name.txt
Set f1 = Nothing

if strDebug = &quot;on&quot; then
' -- Running Notepad to display the file
WshShell.Run &quot;Notepad.exe &quot; & strUPath & strComputerName & &quot;.txt&quot;
WScript.Sleep 100
WshShell.AppActivate strComputerName & &quot;.txt - Notepad&quot;
end if

Set f2 = fso.CreateTextFile(strDPath & strComputerName & &quot;\User.txt&quot;, True)
f2.WriteLine strf2
f2.Close ' User.txt
Set f2 = Nothing

Set f3 = fso.CreateTextFile(strDPath & strComputerName & &quot;\System.txt&quot;, True)
f3.WriteLine strf3 & &quot;;&quot; & Round((Timer - intStart)*100,0)
f3.Close ' System.txt
Set f3 = Nothing

if strCheck = &quot;No&quot; then WshNetwork.RemoveNetworkDrive strUdrive
end sub ' Finish


' ===========================================================================
' Defined Functions
' ===========================================================================
Dim strTemp, strName

Function FolderCreate(strName)
strTemp = strName
If fso.FolderExists(strTemp) = FALSE Then
fso.CreateFolder(strTemp)
End If
strName = strTemp
End Function ' FolderCreate

' -- Processor Slot Types
Function ShowMethod(strName)
strTemp = strName
Select Case strTemp
Case &quot;1&quot; strTemp = &quot;Other&quot;
Case &quot;2&quot; strTemp = &quot;Unknown&quot;
Case &quot;3&quot; strTemp = &quot;Daughter Board&quot;
Case &quot;4&quot; strTemp = &quot;ZIF Socket&quot;
Case &quot;5&quot; strTemp = &quot;Replacement/Piggy Back&quot;
Case &quot;6&quot; strTemp = &quot;None&quot;
Case &quot;7&quot; strTemp = &quot;LIF Socket&quot;
Case &quot;8&quot; strTemp = &quot;Slot 1&quot;
Case &quot;9&quot; strTemp = &quot;Slot 2&quot;
Case &quot;10&quot; strTemp = &quot;370 Pin Socket&quot;
Case &quot;11&quot; strTemp = &quot;Slot A&quot;
Case &quot;12&quot; strTemp = &quot;Slot M&quot;
End Select
ShowMethod = strTemp
End Function ' ShowMethod

' -- I/O Device Protocol Types
Function ShowProtocolType(strName)
strTemp = strName
Select Case strTemp
Case &quot;1&quot; strTemp = &quot;Other&quot;
Case &quot;2&quot; strTemp = &quot;Unknown&quot;
Case &quot;3&quot; strTemp = &quot;EISA&quot;
Case &quot;4&quot; strTemp = &quot;ISA&quot;
Case &quot;5&quot; strTemp = &quot;PCI&quot;
Case &quot;6&quot; strTemp = &quot;ATA/ATAPI&quot;
Case &quot;7&quot; strTemp = &quot;Flexible Diskette&quot;
Case &quot;8&quot; strTemp = &quot;1496&quot;
Case &quot;9&quot; strTemp = &quot;SCSI Parallel Interface&quot;
Case &quot;10&quot; strTemp = &quot;SCSI Fibre Channel Protocol&quot;
Case &quot;11&quot; strTemp = &quot;SCSI Serial Bus Protocol&quot;
Case &quot;12&quot; strTemp = &quot;SCSI Serial Bus Protocol-2 (1394)&quot;
Case &quot;13&quot; strTemp = &quot;SCSI Serial Storage Architecture&quot;
Case &quot;14&quot; strTemp = &quot;VESA&quot;
Case &quot;15&quot; strTemp = &quot;PCMCIA&quot;
Case &quot;16&quot; strTemp = &quot;Universal Serial Bus&quot;
Case &quot;17&quot; strTemp = &quot;Parallel Protocol&quot;
Case &quot;18&quot; strTemp = &quot;ESCON&quot;
Case &quot;19&quot; strTemp = &quot;Diagnostic&quot;
Case &quot;20&quot; strTemp = &quot;I2C&quot;
Case &quot;21&quot; strTemp = &quot;Power&quot;
Case &quot;22&quot; strTemp = &quot;HIPPI&quot;
Case &quot;23&quot; strTemp = &quot;MultiBus&quot;
Case &quot;24&quot; strTemp = &quot;VME&quot;
Case &quot;25&quot; strTemp = &quot;IPI&quot;
Case &quot;26&quot; strTemp = &quot;IEEE-488&quot;
Case &quot;27&quot; strTemp = &quot;RS232&quot;
Case &quot;28&quot; strTemp = &quot;IEEE 802.3 10BASE5&quot;
Case &quot;29&quot; strTemp = &quot;IEEE 802.3 10BASE2&quot;
Case &quot;30&quot; strTemp = &quot;IEEE 802.3 1BASE5&quot;
Case &quot;31&quot; strTemp = &quot;IEEE 802.3 10BROAD36&quot;
Case &quot;32&quot; strTemp = &quot;IEEE 802.3 100BASEVG&quot;
Case &quot;33&quot; strTemp = &quot;IEEE 802.5 Token-Ring&quot;
Case &quot;34&quot; strTemp = &quot;ANSI X3T9.5 FDDI&quot;
Case &quot;35&quot; strTemp = &quot;MCA&quot;
Case &quot;36&quot; strTemp = &quot;ESDI&quot;
Case &quot;37&quot; strTemp = &quot;IDE&quot;
Case &quot;38&quot; strTemp = &quot;CMD&quot;
Case &quot;39&quot; strTemp = &quot;ST506&quot;
Case &quot;40&quot; strTemp = &quot;DSSI&quot;
Case &quot;41&quot; strTemp = &quot;QIC2&quot;
Case &quot;42&quot; strTemp = &quot;Enhanced ATA/IDE&quot;
Case &quot;43&quot; strTemp = &quot;AGP&quot;
Case &quot;44&quot; strTemp = &quot;TWIRP (two-way infrared)&quot;
Case &quot;45&quot; strTemp = &quot;FIR (fast infrared)&quot;
Case &quot;46&quot; strTemp = &quot;SIR (serial infrared)&quot;
Case &quot;47&quot; strTemp = &quot;IrBus&quot;
End Select
ShowProtocolType = strTemp
End Function ' ShowProtocolType

' -- Pointing Device Types
Function ShowPointingDeviceType(strName)
strTemp = strName
Select Case strTemp
Case &quot;1&quot; strTemp = &quot;Other&quot;
Case &quot;2&quot; strTemp = &quot;Unknown&quot;
Case &quot;3&quot; strTemp = &quot;Mouse&quot;
Case &quot;4&quot; strTemp = &quot;Track Ball&quot;
Case &quot;5&quot; strTemp = &quot;Track Point&quot;
Case &quot;6&quot; strTemp = &quot;Glide Point&quot;
Case &quot;7&quot; strTemp = &quot;Touch Pad&quot;
Case &quot;8&quot; strTemp = &quot;Touch Screen&quot;
End Select
ShowPointingDeviceType = strTemp
End Function ' ShowPointingDeviceType

' -- Memory Form Factor
Function ShowMemorySlotType(strName)
strTemp = strName
Select Case strTemp
Case &quot;0&quot; strTemp = &quot;Unknown&quot;
Case &quot;1&quot; strTemp = &quot;Other&quot;
Case &quot;2&quot; strTemp = &quot;SIP&quot;
Case &quot;3&quot; strTemp = &quot;DIP&quot;
Case &quot;4&quot; strTemp = &quot;ZIP&quot;
Case &quot;5&quot; strTemp = &quot;SOJ&quot;
Case &quot;6&quot; strTemp = &quot;Proprietary&quot;
Case &quot;7&quot; strTemp = &quot;SIMM&quot;
Case &quot;8&quot; strTemp = &quot;DIMM&quot;
Case &quot;9&quot; strTemp = &quot;TSOP&quot;
Case &quot;10&quot; strTemp = &quot;PGA&quot;
Case &quot;11&quot; strTemp = &quot;RIMM&quot;
Case &quot;12&quot; strTemp = &quot;SODIMM&quot;
End Select
ShowmemorySlotType = strTemp
End Function ' ShowMemorySlotType

' -- Memory Type
Function ShowMemoryType(strName)
strTemp = strName
Select Case strTemp
Case &quot;1&quot; strTemp = &quot;Unknown&quot;
Case &quot;2&quot; strTemp = &quot;Other&quot;
Case &quot;3&quot; strTemp = &quot;DRAM&quot;
Case &quot;4&quot; strTemp = &quot;Synchronous DRAM&quot;
Case &quot;5&quot; strTemp = &quot;Cache DRAM&quot;
Case &quot;6&quot; strTemp = &quot;EDO&quot;
Case &quot;7&quot; strTemp = &quot;EDRAM&quot;
Case &quot;8&quot; strTemp = &quot;VRAM&quot;
Case &quot;9&quot; strTemp = &quot;SRAM&quot;
Case &quot;10&quot; strTemp = &quot;RAM&quot;
Case &quot;11&quot; strTemp = &quot;ROM&quot;
Case &quot;12&quot; strTemp = &quot;Flash&quot;
Case &quot;13&quot; strTemp = &quot;EEPROM&quot;
Case &quot;14&quot; strTemp = &quot;FEPROM&quot;
Case &quot;15&quot; strTemp = &quot;EPROM&quot;
Case &quot;16&quot; strTemp = &quot;CDRAM&quot;
Case &quot;17&quot; strTemp = &quot;3DRAM&quot;
Case &quot;18&quot; strTemp = &quot;SDRAM&quot;
Case &quot;19&quot; strTemp = &quot;SGRAM&quot;
End Select
ShowmemoryType = strTemp
End Function ' ShowMemoryType
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top