VERSAO WINDOWS
Bom dia, alegme teria alguma ideia baseada em paths ou algum codigo atualizado que posso fazer uma verificação da versao do windows, se e vista, seven ou xp??
pra 32bits e 64 bits tive a ideia de buscar pela pasta de sistema 32 e 64 bits...
desde ja grato!
pra 32bits e 64 bits tive a ideia de buscar pela pasta de sistema 32 e 64 bits...
desde ja grato!
Ve ae se ajuda:
Public Function VerificaSistema()
Dim x As Integer
Dim ss As String
For x = 1 To 15
ss = ss & Environ(x) & vbCrLf
Next x
MsgBox ss
End Function
Private Sub Command1_Click()
VerificaSistema
End Sub
Public Function VerificaSistema()
Dim x As Integer
Dim ss As String
For x = 1 To 15
ss = ss & Environ(x) & vbCrLf
Next x
MsgBox ss
End Function
Private Sub Command1_Click()
VerificaSistema
End Sub
Muito legal o codigo nem imaginava que dava pra fazer isso!, mas infelizmente ele so retorna a plataforma (WINDOWS_NT) tanto no 64 bits quanto no 32 bits e nas versoes do sistema...
mas valew demais!!
mas valew demais!!
Achei esse codigo mas usa o wmi caso alguem saiba algum que use apenas api fico grato!
OBTER TODAS AS INFORMACOES DO SISTEMA OPERACIONAL
Esse dica funcionará sem problemas no Windows 2000 e no XP. Para utlizar a WMI no Windows 98 vocês devem instalar o WMI Core. Vocês podem fazer o download em http://www.microsoft.com/downloads/details.aspx?FamilyID=98a4c5ba-337b-4e92-8c18-a63847760ea5&DisplayLang=en
[ô]referenciar
[ô]Microsoft WMI Scripting v1.1 Library
Private Sub Command1_Click()
On Error Resume Next
Dim dcSet As SWbemObjectSet
Dim objItem As SWbemObject
Set dcSet = GetObject([Ô]winmgmts:{impersonationLevel=impersonate}[Ô]). _
InstancesOf([Ô]Win32_OperatingSystem[Ô])
For Each objItem In dcSet
List1.AddItem [Ô]BootDevice: [Ô] & objItem.BootDevice
List1.AddItem [Ô]BuildNumber: [Ô] & objItem.BuildNumber
List1.AddItem [Ô]BuildType: [Ô] & objItem.BuildType
List1.AddItem [Ô]Caption: [Ô] & objItem.Caption
List1.AddItem [Ô]CodeSet: [Ô] & objItem.CodeSet
List1.AddItem [Ô]CountryCode: [Ô] & objItem.CountryCode
List1.AddItem [Ô]CreationClassName: [Ô] & objItem.CreationClassName
List1.AddItem [Ô]CSCreationClassName: [Ô] & objItem.CSCreationClassName
List1.AddItem [Ô]CSDVersion: [Ô] & objItem.CSDVersion
List1.AddItem [Ô]CSName: [Ô] & objItem.CSName
List1.AddItem [Ô]CurrentTimeZone: [Ô] & objItem.CurrentTimeZone
List1.AddItem [Ô]Debug: [Ô] & objItem.Debug
List1.AddItem [Ô]Description: [Ô] & objItem.Description
List1.AddItem [Ô]Distributed: [Ô] & objItem.Distributed
List1.AddItem [Ô]ForegroundApplicationBoost: [Ô] & objItem.ForegroundApplicationBoost
List1.AddItem [Ô]FreePhysicalMemory: [Ô] & objItem.FreePhysicalMemory
List1.AddItem [Ô]FreeSpaceInPagingFiles: [Ô] & objItem.FreeSpaceInPagingFiles
List1.AddItem [Ô]FreeVirtualMemory: [Ô] & objItem.FreeVirtualMemory
List1.AddItem [Ô]InstallDate: [Ô] & objItem.InstallDate
List1.AddItem [Ô]LastBootUpTime: [Ô] & objItem.LastBootUpTime
List1.AddItem [Ô]LocalDateTime: [Ô] & objItem.LocalDateTime
List1.AddItem [Ô]Locale: [Ô] & objItem.Locale
List1.AddItem [Ô]Manufacturer: [Ô] & objItem.Manufacturer
List1.AddItem [Ô]MaxNumberOfProcesses: [Ô] & objItem.MaxNumberOfProcesses
List1.AddItem [Ô]MaxProcessMemorySize: [Ô] & objItem.MaxProcessMemorySize
List1.AddItem [Ô]Name: [Ô] & objItem.Name
List1.AddItem [Ô]NumberOfLicensedUsers: [Ô] & objItem.NumberOfLicensedUsers
List1.AddItem [Ô]NumberOfProcesses: [Ô] & objItem.NumberOfProcesses
List1.AddItem [Ô]NumberOfUsers: [Ô] & objItem.NumberOfUsers
List1.AddItem [Ô]Organization: [Ô] & objItem.Organization
List1.AddItem [Ô]OSLanguage: [Ô] & objItem.OSLanguage
List1.AddItem [Ô]OSProductSuite: [Ô] & objItem.OSProductSuite
List1.AddItem [Ô]OSType: [Ô] & objItem.OSType
List1.AddItem [Ô]OtherTypeDescription: [Ô] & objItem.OtherTypeDescription
List1.AddItem [Ô]PlusProductID: [Ô] & objItem.PlusProductID
List1.AddItem [Ô]PlusVersionNumber: [Ô] & objItem.PlusVersionNumber
List1.AddItem [Ô]Primary: [Ô] & objItem.Primary
List1.AddItem [Ô]QuantumLength: [Ô] & objItem.QuantumLength
List1.AddItem [Ô]QuantumType: [Ô] & objItem.QuantumType
List1.AddItem [Ô]RegisteredUser: [Ô] & objItem.RegisteredUser
List1.AddItem [Ô]SerialNumber: [Ô] & objItem.SerialNumber
List1.AddItem [Ô]ServicePackMajorVersion: [Ô] & objItem.ServicePackMajorVersion
List1.AddItem [Ô]ServicePackMinorVersion: [Ô] & objItem.ServicePackMinorVersion
List1.AddItem [Ô]SizeStoredInPagingFiles: [Ô] & objItem.SizeStoredInPagingFiles
List1.AddItem [Ô]Status: [Ô] & objItem.Status
List1.AddItem [Ô]SystemDevice: [Ô] & objItem.SystemDevice
List1.AddItem [Ô]SystemDirectory: [Ô] & objItem.SystemDirectory
List1.AddItem [Ô]TotalSwapSpaceSize: [Ô] & objItem.TotalSwapSpaceSize
List1.AddItem [Ô]TotalVirtualMemorySize: [Ô] & objItem.TotalVirtualMemorySize
List1.AddItem [Ô]TotalVisibleMemorySize: [Ô] & objItem.TotalVisibleMemorySize
List1.AddItem [Ô]Version: [Ô] & objItem.Version
List1.AddItem [Ô]WindowsDirectory: [Ô] & objItem.WindowsDirectory
Next
End Sub
Observação: Nem todos os objetos retornam resultados
OBTER TODAS AS INFORMACOES DO SISTEMA OPERACIONAL
Esse dica funcionará sem problemas no Windows 2000 e no XP. Para utlizar a WMI no Windows 98 vocês devem instalar o WMI Core. Vocês podem fazer o download em http://www.microsoft.com/downloads/details.aspx?FamilyID=98a4c5ba-337b-4e92-8c18-a63847760ea5&DisplayLang=en
[ô]referenciar
[ô]Microsoft WMI Scripting v1.1 Library
Private Sub Command1_Click()
On Error Resume Next
Dim dcSet As SWbemObjectSet
Dim objItem As SWbemObject
Set dcSet = GetObject([Ô]winmgmts:{impersonationLevel=impersonate}[Ô]). _
InstancesOf([Ô]Win32_OperatingSystem[Ô])
For Each objItem In dcSet
List1.AddItem [Ô]BootDevice: [Ô] & objItem.BootDevice
List1.AddItem [Ô]BuildNumber: [Ô] & objItem.BuildNumber
List1.AddItem [Ô]BuildType: [Ô] & objItem.BuildType
List1.AddItem [Ô]Caption: [Ô] & objItem.Caption
List1.AddItem [Ô]CodeSet: [Ô] & objItem.CodeSet
List1.AddItem [Ô]CountryCode: [Ô] & objItem.CountryCode
List1.AddItem [Ô]CreationClassName: [Ô] & objItem.CreationClassName
List1.AddItem [Ô]CSCreationClassName: [Ô] & objItem.CSCreationClassName
List1.AddItem [Ô]CSDVersion: [Ô] & objItem.CSDVersion
List1.AddItem [Ô]CSName: [Ô] & objItem.CSName
List1.AddItem [Ô]CurrentTimeZone: [Ô] & objItem.CurrentTimeZone
List1.AddItem [Ô]Debug: [Ô] & objItem.Debug
List1.AddItem [Ô]Description: [Ô] & objItem.Description
List1.AddItem [Ô]Distributed: [Ô] & objItem.Distributed
List1.AddItem [Ô]ForegroundApplicationBoost: [Ô] & objItem.ForegroundApplicationBoost
List1.AddItem [Ô]FreePhysicalMemory: [Ô] & objItem.FreePhysicalMemory
List1.AddItem [Ô]FreeSpaceInPagingFiles: [Ô] & objItem.FreeSpaceInPagingFiles
List1.AddItem [Ô]FreeVirtualMemory: [Ô] & objItem.FreeVirtualMemory
List1.AddItem [Ô]InstallDate: [Ô] & objItem.InstallDate
List1.AddItem [Ô]LastBootUpTime: [Ô] & objItem.LastBootUpTime
List1.AddItem [Ô]LocalDateTime: [Ô] & objItem.LocalDateTime
List1.AddItem [Ô]Locale: [Ô] & objItem.Locale
List1.AddItem [Ô]Manufacturer: [Ô] & objItem.Manufacturer
List1.AddItem [Ô]MaxNumberOfProcesses: [Ô] & objItem.MaxNumberOfProcesses
List1.AddItem [Ô]MaxProcessMemorySize: [Ô] & objItem.MaxProcessMemorySize
List1.AddItem [Ô]Name: [Ô] & objItem.Name
List1.AddItem [Ô]NumberOfLicensedUsers: [Ô] & objItem.NumberOfLicensedUsers
List1.AddItem [Ô]NumberOfProcesses: [Ô] & objItem.NumberOfProcesses
List1.AddItem [Ô]NumberOfUsers: [Ô] & objItem.NumberOfUsers
List1.AddItem [Ô]Organization: [Ô] & objItem.Organization
List1.AddItem [Ô]OSLanguage: [Ô] & objItem.OSLanguage
List1.AddItem [Ô]OSProductSuite: [Ô] & objItem.OSProductSuite
List1.AddItem [Ô]OSType: [Ô] & objItem.OSType
List1.AddItem [Ô]OtherTypeDescription: [Ô] & objItem.OtherTypeDescription
List1.AddItem [Ô]PlusProductID: [Ô] & objItem.PlusProductID
List1.AddItem [Ô]PlusVersionNumber: [Ô] & objItem.PlusVersionNumber
List1.AddItem [Ô]Primary: [Ô] & objItem.Primary
List1.AddItem [Ô]QuantumLength: [Ô] & objItem.QuantumLength
List1.AddItem [Ô]QuantumType: [Ô] & objItem.QuantumType
List1.AddItem [Ô]RegisteredUser: [Ô] & objItem.RegisteredUser
List1.AddItem [Ô]SerialNumber: [Ô] & objItem.SerialNumber
List1.AddItem [Ô]ServicePackMajorVersion: [Ô] & objItem.ServicePackMajorVersion
List1.AddItem [Ô]ServicePackMinorVersion: [Ô] & objItem.ServicePackMinorVersion
List1.AddItem [Ô]SizeStoredInPagingFiles: [Ô] & objItem.SizeStoredInPagingFiles
List1.AddItem [Ô]Status: [Ô] & objItem.Status
List1.AddItem [Ô]SystemDevice: [Ô] & objItem.SystemDevice
List1.AddItem [Ô]SystemDirectory: [Ô] & objItem.SystemDirectory
List1.AddItem [Ô]TotalSwapSpaceSize: [Ô] & objItem.TotalSwapSpaceSize
List1.AddItem [Ô]TotalVirtualMemorySize: [Ô] & objItem.TotalVirtualMemorySize
List1.AddItem [Ô]TotalVisibleMemorySize: [Ô] & objItem.TotalVisibleMemorySize
List1.AddItem [Ô]Version: [Ô] & objItem.Version
List1.AddItem [Ô]WindowsDirectory: [Ô] & objItem.WindowsDirectory
Next
End Sub
Observação: Nem todos os objetos retornam resultados
Tópico encerrado , respostas não são mais permitidas