Afisare informatii sistem de operare folosind VBScript

Configurare noua (How To)

Situatie

Pasul 1:
Copiem codul de mai jos intr-un editor de text.

Set dtmConvertedDate = CreateObject(“WbemScripting.SWbemDateTime”)
strComputer = “.”
strResults=””
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)
Set colOperatingSystems = objWMIService.ExecQuery _
(“Select * from Win32_OperatingSystem”)
For Each objOperatingSystem in colOperatingSystems
strResults=strResults & objOperatingSystem.Caption & vbCR
strResults=strResults & “Version: ” & objOperatingSystem.Version & vbCR
strResults=strResults & “Product ID: ” & objOperatingSystem.SerialNumber & vbCR
strResults=strResults & “Language: ” & objOperatingSystem.OSLanguage & vbCR
strResults=strResults & “Country code: ” & objOperatingSystem.CountryCode & vbCR
strResults=strResults & “Registered user: ” & objOperatingSystem.RegisteredUser & vbCR
strResults=strResults & “Organization: ” & objOperatingSystem.Organization & vbCR
dtmConvertedDate.Value = objOperatingSystem.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
strResults=strResults & “Date installation: ” & dtmInstallDate & vbCR
Next
MsgBox strResults,64,”OSLang”

Pasul 2:
Salvam textul punandu-i orice nume + .vbs la sfarsit.

Rulam scriptul.

In cazul in care codul nu functioneaza, ar trebui sa inlocuim simbolul  ” deoarece site-ul ii schimba formatul.

Solutie

Tip solutie

Permanent

Voteaza

(5 din 10 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?