Visual Basic 6 Help
I am using visual basic 2008 express which I think uses visual basic 6 :S (correct me if I am wrong)
I have mad a nice little application to hand out to teachers which has a few administrative we can ask them to click when they have an issue. Simple stuff really like "ipconfig /renew" and "installrm" It also has a tab with system info on it.
I was wondering if there is a way to get it to display the current XP Service pack in a text box. I have managed to achieve this for computer name etc using
Is there a similar way to show service pack?
TextBoxXYZ.Text = My.Computer.Info.OSFullName
Thank you in advance
Oh probably should mention I am very new to visual basic :)
vb 6 is different to vb 2008 in a lot of ways besides the obvious of being OOP
WMI in vb dot net
DevCity.NET :: WMI connections made easy in VB.NET. Page 1
Using Win32_OperatingSystem wmi class to querry for service pack level in vbscript ( which will need converting / changing to vb .net which is easy enough to do )
WMI and VBScript for Microsoft Operating Systems - Guy's Secrets
Once you have done that then you can assign the outcome / results to a text field
That looks a little bit out of my league to be honest mate. I am not a programmer and my knowledge of VB is obviously not great.
I was hoping there was a more simple way. Oh well, back t the drawing board :P
Try this - again may be a bit too involved but it may help
Viewing System information - VB.NET
That's .NET again and doesn't mention how to get Service Pack info (as far I can see). There is what looks like a good example script here (click link).
Originally Posted by sister_annex
Specifically for VB6:
This adds the info the the respective labels noted above although obviously you could assign it to anything (text box, variable etc). I haven't checked if this code works as I only have VB6 at home and not in the school.
Private Sub Form_Load()
' Get the OS information.
' For more information from this query, see:
Dim os_query As String
Dim os_results As Object
Dim info As Object
os_query = "SELECT * FROM Win32_OperatingSystem"
Set os_results = _
For Each info In os_results
lblCaption.Caption = info.Caption
lblVersion.Caption = "Version " & _
info.Version & _
" SP " & _
info.ServicePackMajorVersion & "." & _
@dgssmith Thank you for this it looks more what I am looking for. I intend to put the information into a text box in my program so that we can ask users to look up their service pack over the phone in 1 step.
This scrpit is giving me some errors. (if this is being being a noob I am sorry)
name 'lblcaption' is not declared
name 'lblversion' is not declared
Just realised it is my being a fool.... they are not declared because I need to swap them for the name of my text boxs...
Working :) THank you all.
Next I must try and find a way to run the wireless repair wizard from a button.... GO GO GOOGLE!