Accueil > Forum > > > > Affichage avec Wscript.Echo
Affichage avec Wscript.Echo
dimanche 15 juin 2008 à 01:57:13 |
Affichage avec Wscript.Echo

Leo_Robotic_Passion
|
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
|
|
dimanche 15 juin 2008 à 11:45:39 |
Re : Affichage avec Wscript.Echo

JMO
|
Réponse acceptée !
 Bonjour, En passant par une variable: strComputer = "." Dim strResult Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSettings = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colSettings strResult = "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 strResult = strResult & vbCrLf & _ "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 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 = Nothingjean-marc
|
|
dimanche 15 juin 2008 à 12:46:07 |
Re : Affichage avec Wscript.Echo
|
dimanche 15 juin 2008 à 21:49:07 |
Re : Affichage avec Wscript.Echo

Leo_Robotic_Passion
|
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 ?
|
|
dimanche 15 juin 2008 à 23:22:42 |
Re : Affichage avec Wscript.Echo

JMO
|
 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 = Nothingjean-marc
|
|
Cette discussion est classée dans : vbcrlf, wscript, echo, objoperatingsystem, colsettings
Répondre à ce message
Sujets en rapport avec ce message
lire un xml avec vbs [ par ElPiojo ]
Bonjour,J'ai de gros probleme pour recuperer les données dans un fichier xml.Voila mon code : Option Explicit Dim xmlDoc : Set xmlDoc = CreateObject(
Déclaration de variables / VBS [ par magnum42 ]
Bonjour, Je suis en train de coder un script VBS qui cherche certains évènements dansl'eventlog de serveurs distants. Il n'est pas fini, mais il fon
Ping VBS et WMI [ par flopad ]
Bonjour, j'ai le code suivant :If Wscript.Arguments.Count = 0 Then Wscript.Echo "You must enter the computer name when starting this script." Ws
problème de copier(excel) / coller(mailto) [ par JMO ]
Bonjour,J'avais déjà posté mon petit problème sur le Forum, mais hélas, pour moi, pas de réponse.En vbs, j'arrive à faire un copier de x range (fichie
Liste Permissions sur partages [ par jubustar21 ]
Bonjour,j'ai beau chercher je ne trouve pas et j'en deviens à me demander si ce que je veux est possible... O_oVoilà, je peux lister les partages sur
PB ecriture dans fichier [ par ben008 ]
Bonjour ,J'ai recuperer un script VBS de ce cher JCB :D modifié afin de mettre une liste d'imprimantes des differents serveurs d'impressions dans un f
Retrouver le numero serie d'un pc [ par mute7145 ]
Bonjour, je cherche le moyen de retrouver le numero de serie de mon pc En utilisant pas mal de logiciel et dernierment WMICodeCreator avec le script s
[Déplacé VB6 --> VBS] Lister les fichiers et répertoires d'un dossier [ par axlemush ]
Bonjours, j'éssaye de créer une applicationn en VBScript qui liste les fichiers et dossiers/sous-dossiers/ect ... d'un répertoire. Mais mon script bug
ereur commande set [ par kipetro ]
Bonjour, j'ai une ereur au moment de la commande Set sur ce script, vous seriez m'aidé?:Option explicitOn Error Resume NextConst ONE_HOUR = 3600000dim
Sript qui fonctione sous vista, erreur sous xp [ par narco4 ]
Bonsoir chers amis,j'ai un prb avec un script.vbs qui fonctionne sous vista, erreur sous xp alors que le fichier en question est present!script.vbs so
Livres en rapport
|
Derniers Blogs
SESSION SILVERLIGHT 5 3D : SLIDES ET DEMOSSESSION SILVERLIGHT 5 3D : SLIDES ET DEMOS par Groc
Durant les techdays, j'ai eu le plaisir d'animer une session sur Silverlight 5 et la 3D avec Simon Ferquel. Comme promis, voici nos slides et mes démos (celles avec le viper BSG) ici et là. Pour mémoire, les démos utilisent toutes le viper BSG...
Cliquez pour lire la suite de l'article par Groc [TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES[TECHDAYS 2012] SESSION WEBMATRIX 2 : LE COUTEAU SUISSE GRATUIT POUR VOS DéVELOPPEMENTS WEB - SLIDES par gpommier
Suite à la session que j'ai présenté sur WebMatrix 2, vous pouvez trouver les slides ici, ainsi que les démos en packages nuget : démos1 et démos2 J'en profite pour remercier chaleureusement tous ceux qui sont venus très nombreux à cette sess...
Cliquez pour lire la suite de l'article par gpommier [SHAREPOINT] LES SESSIONS TECHDAYS 2012.[SHAREPOINT] LES SESSIONS TECHDAYS 2012. par Patrick Guimonet
Voici donc pour ceux qui n'ont pas pu venir, ou ceux qui n'ont pas pu toutes les suivre la liste des sessions SharePoint aux TechDays 2012, que je mettrais à jour dès que les liens des vidéo seront disponibles. Ou ici : http...
Cliquez pour lire la suite de l'article par Patrick Guimonet TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3TECHDAYS PARIS 2012 : SESSION PLEINIèRE JOUR 3 par ROMELARD Fabrice
Speaker: Bernard Ourghanlian Cette session est comme chaque jour transmise en live par BrainSonic, et j'ai donc suivi cette troisième pleinière par ce moyen sur mon iPad . Elle est dédiée comme chaque année à la mise en perspective de l'é...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE !MISHRA READER : UN LECTEUR RSS TRèS ZUNE STYLE EN OPEN SOURCE ! par Vko
Hier durant une session dédiée aux Techdays 2012, j'ai eu le plaisir d'annoncer la sortie de la Béta 2 de Mishra Reader. C'est quoi ? Pour les utilisateurs, c'est une vraie expérience de lecture de flux RSS sur Windows. Rien à voir avec les produit...
Cliquez pour lire la suite de l'article par Vko
Logiciels
Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning
|