+ Post New Thread
Results 1 to 8 of 8
Coding Thread, Visual Basic 6 Help in Coding and Web Development; Hello, I am using visual basic 2008 express which I think uses visual basic 6 :S (correct me if I ...
  1. #1

    Join Date
    Nov 2009
    Location
    Weymouth
    Posts
    37
    Thank Post
    1
    Thanked 3 Times in 3 Posts
    Rep Power
    11

    Visual Basic 6 Help

    Hello,

    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

    Code:
    TextBoxXYZ.Text = My.Computer.Info.OSFullName
    Is there a similar way to show service pack?

    Thank you in advance

    Oh probably should mention I am very new to visual basic

  2. #2

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,944
    Thank Post
    3,476
    Thanked 1,092 Times in 1,007 Posts
    Rep Power
    371
    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

  3. #3

    Join Date
    Nov 2009
    Location
    Weymouth
    Posts
    37
    Thank Post
    1
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    @mac_shinobi

    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

  4. #4
    sister_annex's Avatar
    Join Date
    Jan 2009
    Location
    Wolverhampton
    Posts
    604
    Thank Post
    102
    Thanked 142 Times in 123 Posts
    Rep Power
    51
    Try this - again may be a bit too involved but it may help

    Viewing System information - VB.NET

  5. #5
    dgsmith's Avatar
    Join Date
    Nov 2007
    Location
    Merseyside, England
    Posts
    1,110
    Thank Post
    119
    Thanked 90 Times in 78 Posts
    Rep Power
    37
    Quote Originally Posted by sister_annex View Post
    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).

    Specifically for VB6:
    Code:
    Private Sub Form_Load()
        ' Get the OS information.
        ' For more information from this query, see:
        '      http:'msdn.microsoft.com/library/aa394239.aspx
        Dim os_query As String
        Dim os_results As Object
        Dim info As Object
    
        os_query = "SELECT * FROM Win32_OperatingSystem"
        Set os_results = _
            GetObject("Winmgmts:").ExecQuery(os_query)
        For Each info In os_results
            lblCaption.Caption = info.Caption
            lblVersion.Caption = "Version " & _
                info.Version & _
                " SP " & _
                info.ServicePackMajorVersion & "." & _
                info.ServicePackMinorVersion
        Next info
    End Sub
    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.

  6. #6

    Join Date
    Nov 2009
    Location
    Weymouth
    Posts
    37
    Thank Post
    1
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    @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

    Thanks

  7. #7

    Join Date
    Nov 2009
    Location
    Weymouth
    Posts
    37
    Thank Post
    1
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    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...

    Thanks

  8. #8

    Join Date
    Nov 2009
    Location
    Weymouth
    Posts
    37
    Thank Post
    1
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    Working THank you all.

    Next I must try and find a way to run the wireless repair wizard from a button.... GO GO GOOGLE!



SHARE:
+ Post New Thread

Similar Threads

  1. Visual Basic 2008 help
    By DSapseid in forum Coding
    Replies: 1
    Last Post: 24th June 2009, 12:03 PM
  2. Im New To Visual Basic 2008....HELP!!!!!
    By firerescue in forum Coding
    Replies: 2
    Last Post: 17th December 2008, 12:10 PM
  3. Visual Basic 6 and administrative priveleges
    By googlemad in forum Windows
    Replies: 0
    Last Post: 5th February 2008, 12:06 PM
  4. Visual Basic 6
    By Samson in forum Windows
    Replies: 4
    Last Post: 30th August 2007, 01:41 PM
  5. Visual basic 6
    By Halfmad in forum Windows
    Replies: 9
    Last Post: 11th June 2007, 03:57 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •