Çözüldü - Donanım Bilgileri Gösteren VBS ve JSON Betikleri

Programlama dilleri konusunda bilgi paylaşım alanıdır.
Cevapla
Kullanıcı avatarı
trwe
Petabyte3
Petabyte3
Mesajlar: 7251
Kayıt: 25 Eyl 2013, 13:38
cinsiyet: Erkek
Konum: Türkiye Cumhuriyeti

Çözüldü - Donanım Bilgileri Gösteren VBS ve JSON Betikleri

Mesaj gönderen trwe » 17 Kas 2018, 00:26

Merhabalar

Aşağıda verilen ve aynı kod yapısına sahip farklı uzantıya sahip betikler de sorunu bir türlü çözemedim.(kırk yılda bir heveslendim betik yazmaya ama nerede hata yapıyorum bilmiyorum ) Forum kıdemli üyelerinden bu konuda yardım istemekteyim.Böylece teferuaatlı bir donanım bilgisi veren betik elimizde olacak

Microsoft VBS:

Kod: Tümünü seç

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
Wscript.Echo "Version: " & objOperatingSystem.Version
Wscript.Echo "Service Pack: " & _ objOperatingSystem.ServicePackMajorVersion _ & "." & objOperatingSystem.ServicePackMinorVersion
Wscript.Echo "OS Manufacturer: " & objOperatingSystem.Manufacturer
Wscript.Echo "Windows Directory: " & _ objOperatingSystem.WindowsDirectory
Wscript.Echo "Locale: " & objOperatingSystem.Locale
Wscript.Echo "Available Physical Memory: " & _ objOperatingSystem.FreePhysicalMemory
Wscript.Echo "Total Virtual Memory: " & _ objOperatingSystem.TotalVirtualMemorySize
Wscript.Echo "Available Virtual Memory: " & _ objOperatingSystem.FreeVirtualMemory
Wscript.Echo "OS Name: " & objOperatingSystem.SizeStoredInPagingFiles
Next
Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
Wscript.Echo "System Name: " & objComputer.Name
Wscript.Echo "System Manufacturer: " & objComputer.Manufacturer
Wscript.Echo "System Model: " & objComputer.Model
Wscript.Echo "Time Zone: " & objComputer.CurrentTimeZone
Wscript.Echo "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
Wscript.Echo "Processor: " & objProcessor.Description
Next
Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_BIOS")
For Each objBIOS in colSettings
Wscript.Echo "BIOS Version: " & objBIOS.Version
Next
Microsoft JSON (Ekran görüntüsüde sarı renkli deneme1 isimli dosya)

Kod: Tümünü seç

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
Wscript.Echo "Version: " & objOperatingSystem.Version
Wscript.Echo "Service Pack: " & _ objOperatingSystem.ServicePackMajorVersion _ & "." & objOperatingSystem.ServicePackMinorVersion
Wscript.Echo "OS Manufacturer: " & objOperatingSystem.Manufacturer
Wscript.Echo "Windows Directory: " & _ objOperatingSystem.WindowsDirectory
Wscript.Echo "Locale: " & objOperatingSystem.Locale
Wscript.Echo "Available Physical Memory: " & _ objOperatingSystem.FreePhysicalMemory
Wscript.Echo "Total Virtual Memory: " & _ objOperatingSystem.TotalVirtualMemorySize
Wscript.Echo "Available Virtual Memory: " & _ objOperatingSystem.FreeVirtualMemory
Wscript.Echo "OS Name: " & objOperatingSystem.SizeStoredInPagingFiles
Next
Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
Wscript.Echo "System Name: " & objComputer.Name
Wscript.Echo "System Manufacturer: " & objComputer.Manufacturer
Wscript.Echo "System Model: " & objComputer.Model
Wscript.Echo "Time Zone: " & objComputer.CurrentTimeZone
Wscript.Echo "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
Wscript.Echo "Processor: " & objProcessor.Description
Next
Set colSettings = objWMIService.ExecQuery _ ("Select * from Win32_BIOS")
For Each objBIOS in colSettings
Wscript.Echo "BIOS Version: " & objBIOS.Version
Next
Hata Ekran Görüntüsü

Resim

Bu kodlamaya bir hafta önce başlamıştım burada yarıda kaldı.

Eğer hata çözülebilirse bu betik sordum'a armağan edilecek.....

TRWE_2012
TRWE_2016
FEDAKARLIK OLMADAN ZAFER OLMAZ....!
-----------------------------
LINUXMASTER 2018
ZAFER'E GİDEN YOL,FEDAKARLIKTAN GEÇER...!
-----------------------------
BATTALGAZİ 2023
Heaven to My Friend, Hell to My Enemy ....!



Kullanıcı avatarı
velociraptor
Yottabyte3
Yottabyte3
Mesajlar: 29889
Kayıt: 14 Mar 2006, 02:33
cinsiyet: Erkek

Re: Donanım Bilgileri Gösteren VBS ve JSON Betikleri

Mesaj gönderen velociraptor » 17 Kas 2018, 02:15

VBS Olanı aşağıdaki şekilde olacak

Kod: Tümünü seç

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
Wscript.Echo "Version: " & objOperatingSystem.Version
Wscript.Echo "Service Pack: " & objOperatingSystem.ServicePackMajorVersion& "." & objOperatingSystem.ServicePackMinorVersion
Wscript.Echo "OS Manufacturer: " & objOperatingSystem.Manufacturer
Wscript.Echo "Windows Directory: " & objOperatingSystem.WindowsDirectory
Wscript.Echo "Locale: " & objOperatingSystem.Locale
Wscript.Echo "Available Physical Memory: " & objOperatingSystem.FreePhysicalMemory
Wscript.Echo "Total Virtual Memory: " & objOperatingSystem.TotalVirtualMemorySize
Wscript.Echo "Available Virtual Memory: " & objOperatingSystem.FreeVirtualMemory
Wscript.Echo "OS Name: " & objOperatingSystem.SizeStoredInPagingFiles
Next
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
Wscript.Echo "System Name: " & objComputer.Name
Wscript.Echo "System Manufacturer: " & objComputer.Manufacturer
Wscript.Echo "System Model: " & objComputer.Model
Wscript.Echo "Time Zone: " & objComputer.CurrentTimeZone
Wscript.Echo "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
Wscript.Echo "Processor: " & objProcessor.Description
Next
Set colSettings = objWMIService.ExecQuery("Select * from Win32_BIOS")
For Each objBIOS in colSettings
Wscript.Echo "BIOS Version: " & objBIOS.Version
Next
Knowledge determines destiny, And ye shall know the Truth and the Truth shall make you free

Kullanıcı avatarı
trwe
Petabyte3
Petabyte3
Mesajlar: 7251
Kayıt: 25 Eyl 2013, 13:38
cinsiyet: Erkek
Konum: Türkiye Cumhuriyeti

Re: Donanım Bilgileri Gösteren VBS ve JSON Betikleri

Mesaj gönderen trwe » 17 Kas 2018, 02:26

Eline sağlık ama şunlara bir anlam veremedim.

Resim
Resim
Resim

Ve son olarak Time Zon :120 ibaresi göstermekte açıkçası bunlar ne anlama geliyor...Bilmiyorum ama genel hatlarıyla işe yarıyor .Sağ olasın admin Velociraptor....

Yani hiç çalışmamasından iyidir bu durum tekrar teşekkürler Velociraptor
TRWE_2016
FEDAKARLIK OLMADAN ZAFER OLMAZ....!
-----------------------------
LINUXMASTER 2018
ZAFER'E GİDEN YOL,FEDAKARLIKTAN GEÇER...!
-----------------------------
BATTALGAZİ 2023
Heaven to My Friend, Hell to My Enemy ....!

Kullanıcı avatarı
velociraptor
Yottabyte3
Yottabyte3
Mesajlar: 29889
Kayıt: 14 Mar 2006, 02:33
cinsiyet: Erkek

Re: Donanım Bilgileri Gösteren VBS ve JSON Betikleri

Mesaj gönderen velociraptor » 17 Kas 2018, 13:37

Onları çıkartan ilgili satırları sil bence , böylece daha anlamlı olacaktır. Bu arada aşağıda zaten bu konuda bir çalışmamız vardı, Teşekürler
https://www.sordum.net/46139/vbs-ile-do ... ini-bulun/
Knowledge determines destiny, And ye shall know the Truth and the Truth shall make you free

Cevapla