BBAT BATCH ON-LINE
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Connexion

Récupérer mon mot de passe

Qui est en ligne ?
Il y a en tout 3 utilisateurs en ligne :: 0 Enregistré, 0 Invisible et 3 Invités

Aucun

Le record du nombre d'utilisateurs en ligne est de 29 le Mer 29 Jan 2020, 10:53
Derniers sujets
» [StackOverflow] Batch to Create video .srt Subtitles with right timing
[VBS] Obtenir informations sur le matériel et les logiciels EmptyVen 25 Déc 2015, 14:17 par Sachadee

» [devellopez] Formater une date en ligne Dos
[VBS] Obtenir informations sur le matériel et les logiciels EmptyVen 31 Juil 2015, 10:40 par Dylan Gadacha

» Un super Tuto Batch de IniTScreen
[VBS] Obtenir informations sur le matériel et les logiciels EmptyLun 08 Juin 2015, 12:16 par InitScreen

» Un code MATRIX sympa
[VBS] Obtenir informations sur le matériel et les logiciels EmptyDim 12 Avr 2015, 14:27 par Sachadee

» [BAT/EXE] DresolChange changer la sesolution de l´écran
[VBS] Obtenir informations sur le matériel et les logiciels EmptyMar 17 Mar 2015, 09:12 par Sachadee

» [EXE/bat] DpScript Código Delphi interpreter
[VBS] Obtenir informations sur le matériel et les logiciels EmptyJeu 12 Mar 2015, 15:48 par Sachadee

» Externo SaveDlg com 2 kb
[VBS] Obtenir informations sur le matériel et les logiciels EmptyDim 15 Fév 2015, 12:20 par Sachadee

» présentation
[VBS] Obtenir informations sur le matériel et les logiciels EmptyDim 15 Fév 2015, 12:14 par Sachadee

» [developpez.com] Transcodage fichier vidéo si fichier déposé
[VBS] Obtenir informations sur le matériel et les logiciels EmptyMar 03 Fév 2015, 01:02 par Sachadee

Flux RSS



Flag Counter
Partenaires
Le deal à ne pas rater :
Coffret dresseur d’élite ETB Pokémon EV06 Mascarade Crépusculaire
56.90 €
Voir le deal

[VBS] Obtenir informations sur le matériel et les logiciels

2 participants

Aller en bas

[VBS] Obtenir informations sur le matériel et les logiciels Empty [VBS] Obtenir informations sur le matériel et les logiciels

Message par Delmar Grande Sam 15 Juin 2013, 04:03

hardware.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.
Delmar Grande
Delmar Grande
EQUIPE BBAT
EQUIPE BBAT

Mensagens : 170
Data de inscrição : 14/06/2013
Localização : Devant le pc

http://dbatchscript.forumeiros.com/

Revenir en haut Aller en bas

[VBS] Obtenir informations sur le matériel et les logiciels Empty Re: [VBS] Obtenir informations sur le matériel et les logiciels

Message par Hackoo Sam 15 Juin 2013, 22:34

Merci pour le partage [Vous devez être inscrit et connecté pour voir cette image]
Hackoo
Hackoo
EQUIPE BBAT
EQUIPE BBAT

Mensagens : 135
Data de inscrição : 06/06/2013
Localização : Tunisie

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum