Connexion
Qui est en ligne ?
Il y a en tout 1 utilisateur en ligne :: 0 Enregistré, 0 Invisible et 1 Invité Aucun
Le record du nombre d'utilisateurs en ligne est de 76 le Ven 22 Nov 2024, 12:39
Sujets les plus vus
Derniers sujets
[VBS] Obtenir informations sur le matériel et les logiciels
2 participants
Page 1 sur 1
[VBS] Obtenir informations sur le matériel et les logiciels
hardware.vbs
software.vbs
Obs; são dois vbs ta pessoal.
Observation Sont deux vbs.
- Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
NomeComputador = objItem.Caption
Next
'----------------------------- Cria o arquivo
Dim fso, txtfile
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtfile = fso.CreateTextFile(NomeComputador & ".html", True)
txtfile.Write ("<strong>Relatório de Hardware:</strong><br><br>")
txtfile.WriteBlankLines(3)
'--------------- Software
strComputer = "."
strProperties = "*"'"CSName, Caption, OSType, Version, OSProductSuite, BuildNumber, ProductType, OSLanguage, CSDVersion, InstallDate, RegisteredUser, Organization, SerialNumber, WindowsDirectory, SystemDirectory"
objClass = "Win32_OperatingSystem"
strQuery = "SELECT " & strProperties & " FROM " & objClass
Set colOS = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem in colOS
txtfile.Write ("<inventario>")
'===================================================================================
txtfile.write ("<strong>Nome do Computador:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.CSName)
txtfile.WriteBlankLines(1)
txtfile.write ("<br><strong>Sistema Operacional:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.Caption)
txtfile.WriteBlankLines(1)
If SO_Type = 16 Then
SO_Name = "Microsoft Windows 95</strong><br>"
ElseIf SO_Type = 17 Then
SO_Name = "Microsoft Windows 98"
End If
If SO_ProdType = 1 Then
SO_ProdType = "Estação de Trabalho"
ElseIf SO_ProdType = 2 Then
SO_ProdType = "Controlador de Domínio"
ElseIf SO_ProdType = 3 Then
SO_ProdType = "Servidor"
End If
If SO_Language = 1033 Then
SO_Language = "Inglês - Estados Unidos"
ElseIf SO_Language = 1046 Then
SO_Language = "Português - Brasil"
Else
SO_Language = "Outro idioma"
End If
If SO_Suite = 1 Then
SO_Suite = "Small Business"
ElseIf SO_Suite = 2 Then
SO_Suite = "Enterprise"
ElseIf SO_Suite = 4 Then
SO_Suite = "Backoffice"
ElseIf SO_Suite = 8 Then
SO_Suite = "Communication Server"
ElseIf SO_Suite = 16 Then
SO_Suite = "Terminal Server"
ElseIf SO_Suite = 18 Then
SO_Suite = "Enterprise e Terminal Server"
ElseIf SO_Suite = 32 Then
SO_Suite = "Small Business (Restrito)"
ElseIf SO_Suite = 64 Then
SO_Suite = "Embedded NT"
ElseIf SO_Suite = 128 Then
SO_Suite = "Data Center"
ElseIf SO_Suite = 256 Then
SO_Suite = "Single User"
ElseIf SO_Suite = 512 Then
SO_Suite = "Personal"
ElseIf SO_Suite = 1024 Then
SO_Suite = "Blade"
End If
Next
'------------------------------------------------------ Usuario----
txtfile.WriteBlankLines(1)
txtfile.write ("<br><strong>Usuário:</strong>")
txtfile.WriteBlankLines(1)
objClass = "Win32_ComputerSystem"
strQuery = "SELECT " & strProperties & " FROM " & objClass
Set colSys = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem in colSys
txtfile.write (objItem.UserName)
txtfile.WriteBlankLines(1)
Next
'-------------------------------Processador3
txtfile.write("<br><strong>Processador:</strong>")
txtfile.WriteBlankLines(1)
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_Processor",,48)
For Each objItem in colItems
'------------------------------------------------- Nome do processador
txtfile.write (objItem.name)
txtfile.WriteBlankLines(1)
'------------------------------------------------- Clock
txtfile.write ("<br><strong>Clock:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.CurrentClockSpeed & " MHZ")
txtfile.WriteBlankLines(1)
Next
'----------------------------------Memoria
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_physicalmemory",,48)
For Each objItem in colItems
'------------------------------------------------- Nome do Banco
'------------------------------------------------- Capacidade
txtfile.write ("<br><strong>Memórias:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.capacity/1048576)
txtfile.WriteBlankLines(1)
Next
'---------------------------------- hd
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_diskdrive",,48)
For Each objItem in colItems
'------------------------------------------------- modelo do disco
txtfile.write ("<br><strong>Modelo do Disco:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.caption)
txtfile.WriteBlankLines(1)
'----------------------------------------------------- Tamanho
txtfile.write ("<br><strong>Tamanho:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (int(objItem.size/1073741824) & " GB")
txtfile.WriteBlankLines(1)
Next
'------------------------------------------------- Nome do adaptador
strComputer = "."
strProperties = "Description, MACAddress, IPAddress, IPSubnet, DefaultIPGateway, DNSServerSearchOrder, DNSDomain, DNSDomainSuffixSearchOrder, DHCPEnabled, DHCPServer, WINSPrimaryServer, WINSSecondaryServer, ServiceName"
objClass = "Win32_NetworkAdapterConfiguration"
strQuery = "SELECT " & strProperties & " FROM " & objClass & " WHERE IPEnabled = True AND ServiceName <> 'AsyncMac' AND ServiceName <> 'VMnetx' AND ServiceName <> 'VMnetadapter' AND ServiceName <> 'Rasl2tp' AND ServiceName <> 'PptpMiniport' AND ServiceName <> 'Raspti' AND ServiceName <> 'NDISWan' AND ServiceName <> 'RasPppoe' AND ServiceName <> 'NdisIP' AND ServiceName <> ''"
Set colAdapters = objWMIService.ExecQuery(strQuery, , wbemFlagReturnImmediately + wbemFlagForwardOnly)
'--------------------------------------------------------rede
For Each objItem in colAdapters
'For Each objItem in colItems
txtfile.write ("<br><strong>Adaptador:</strong>")
txtfile.WriteBlankLines(1)
txtfile.write (objItem.Description)
txtfile.WriteBlankLines(1)
'------------------------------------------------- IP
'txtfile.write ("<br><strong>Sistema Operacional:</strong>")
txtfile.write ("<br><strong>Endereco de IP:</strong>")
txtfile.WriteBlankLines(1)
IP_Address = objItem.IPAddress
txtfile.write (IP_Address(i))
txtfile.WriteBlankLines(1)
'===========================================================================
Next
software.vbs
- Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_ComputerSystem",,48)
For Each objItem in colItems
NomeComputador = objItem.Caption
Next
'----------------------------- Cria o arquivo
Dim fso, txtfile
Set fso = CreateObject("Scripting.FileSystemObject")
Set txtfile = fso.CreateTextFile(NomeComputador & ".html", True)
'txtfile.Write ("<inventarios>")
txtfile.WriteBlankLines(1)
'txtfile.write ("<Inventario>")
txtfile.WriteBlankLines(1)
'--------------- Software
txtfile.write ("<Softwares>")
txtfile.WriteLine("<strong>Programas:</strong><br>")
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
Software = subkey
txtfile.writeline(Software )
txtfile.writeline("<br>")
txtfile.WriteBlankLines(1)
Next
'txtfile.write ("</Softwares>")
'txtfile.WriteBlankLines(1)
'txtfile.WriteLine("</Inventario>")
'txtfile.WriteBlankLines(1)
'txtfile.Write ("</inventarios>")
Obs; são dois vbs ta pessoal.
Observation Sont deux vbs.
Hackoo- EQUIPE BBAT
- Mensagens : 135
Data de inscrição : 06/06/2013
Localização : Tunisie
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
Ven 25 Déc 2015, 14:17 par Sachadee
» [devellopez] Formater une date en ligne Dos
Ven 31 Juil 2015, 10:40 par Dylan Gadacha
» Un super Tuto Batch de IniTScreen
Lun 08 Juin 2015, 12:16 par InitScreen
» Un code MATRIX sympa
Dim 12 Avr 2015, 14:27 par Sachadee
» [BAT/EXE] DresolChange changer la sesolution de l´écran
Mar 17 Mar 2015, 09:12 par Sachadee
» [EXE/bat] DpScript Código Delphi interpreter
Jeu 12 Mar 2015, 15:48 par Sachadee
» Externo SaveDlg com 2 kb
Dim 15 Fév 2015, 12:20 par Sachadee
» présentation
Dim 15 Fév 2015, 12:14 par Sachadee
» [developpez.com] Transcodage fichier vidéo si fichier déposé
Mar 03 Fév 2015, 01:02 par Sachadee