Leo_Robotic_Passion
Messages postés135Date d'inscriptiondimanche 19 novembre 2000StatutMembreDernière intervention 2 décembre 2011
-
15 juin 2008 à 01:57
cs_JMO
Messages postés1854Date d'inscriptionjeudi 23 mai 2002StatutMembreDernière intervention24 juin 2018
-
15 juin 2008 à 23:22
Bonsoir a tous,
Pourriez vous me dire si il est possible d’afficher les infos de ce vbs sur un seul Wscript.Echo et non pas sur 4, comme c’est le cas actuellement?
Et si oui comment ? ^^
Merci
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colSettings
Wscript.Echo "OS Name: " & objOperatingSystem.Name & vbcrlf & _
"Version: " & objOperatingSystem.Version & vbcrlf & _
"Service Pack: " & objOperatingSystem.ServicePackMajorVersion & _
"." & objOperatingSystem.ServicePackMinorVersion & vbcrlf & _
"OS Manufacturer: " & objOperatingSystem.Manufacturer & vbcrlf & _
"Windows Directory: " & objOperatingSystem.WindowsDirectory & vbcrlf & _
"Locale: " & objOperatingSystem.Locale & vbcrlf & _
"Available Physical Memory: " & objOperatingSystem.FreePhysicalMemory & vbcrlf & _
"Total Virtual Memory: " & objOperatingSystem.TotalVirtualMemorySize & vbcrlf & _
"Available Virtual Memory: " & objOperatingSystem.FreeVirtualMemory & vbcrlf & _
"OS Name: " & objOperatingSystem.SizeStoredInPagingFiles
Next
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
Wscript.Echo "System Name: " & objComputer.Name & vbcrlf & _
"System Manufacturer: " & objComputer.Manufacturer & vbcrlf & _
"System Model: " & objComputer.Model & vbcrlf & _
"Time Zone: " & objComputer.CurrentTimeZone & vbcrlf & _
"Total Physical Memory: " & objComputer.TotalPhysicalMemory
Next
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_Processor")
For Each objProcessor in colSettings
Wscript.Echo "System Type: " & objProcessor.Architecture & vbcrlf & _
"Processor: " & objProcessor.Description
Next
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_BIOS")
For Each objBIOS in colSettings
Wscript.Echo "BIOS Version: " & objBIOS.Version
Next
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_Processor")
For Each objProcessor in colSettings
strResult = strResult & vbCrLf & _
"System Type: " & objProcessor.Architecture & vbcrlf & _
"Processor: " & objProcessor.Description
Next
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_BIOS")
For Each objBIOS in colSettings
strResult = strResult & vbCrLf & "BIOS Version: " & objBIOS.Version
Next
WScript.Echo strResult
Set objWMIService = Nothing
Set colSettings = Nothing
Leo_Robotic_Passion
Messages postés135Date d'inscriptiondimanche 19 novembre 2000StatutMembreDernière intervention 2 décembre 2011 15 juin 2008 à 12:46
Leo_Robotic_Passion
Messages postés135Date d'inscriptiondimanche 19 novembre 2000StatutMembreDernière intervention 2 décembre 2011 15 juin 2008 à 21:49
Bonsoir,
J’ai tenté de récupérer l’adresse IP comme ceci :
Set colAdapters objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled True")
For Each objAdapter in colAdapters
strResult = strResult & vbCrLf & "IP address:" & objAdapter.IPAddress
Next
Un message d’erreur me dit type incompatible
Code 800A000D
Je ne voix pas ou je fait erreur !
Un peux d’aide SVP ?
cs_JMO
Messages postés1854Date d'inscriptionjeudi 23 mai 2002StatutMembreDernière intervention24 juin 201827 15 juin 2008 à 23:22
Bonsoir,
Possibilité d'affiner la recherche de l'IP.
On Error Resume Next
Set colAdapters = GetObject("winmgmts:{impersonationLevel=impersonate}!//" & Computer).ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=True")
If Err.Number <> 0 Then
WScript.Echo "IP inconnue"
Else
For Each objAdapter in colAdapters
If InStr(objAdapter.Description,"WAN") Then
WScript.Echo "Adresse IP" & vbTab & objAdapter.IPAddress(0) & vbCrLf & _
"DNSHostName" & vbTab & objAdapter.DNSHostName
End if
Next
End If
Set colAdapters = Nothing