I have Vbscript code.but i want vbscript to vb.net code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sabitawoonna
    New Member
    • Oct 2009
    • 2

    #1

    I have Vbscript code.but i want vbscript to vb.net code

    Code:
    strMsg = "This script will test the HardwareInfo object by reporting the values for the hardware info properties."
    strMsg = strMsg & " Please check the bios and computer properties to verify the tests. This test should be run on a "
    strMsg = strMsg & " variety of hardware platforms to verify it's successful operation."
    strMsg = strMsg & " Press OK to begin the tests."
    idResult = MsgBox (strMsg, VBOkCancel)
    
    If idResult = VBCancel Then wscript.quit
    
    Set objHardware = CreateObject ("icf.hardwareinfo")
    Call showem
    Set wargs = wscript.arguments
    If wArgs.count > 0 Then
    objHardware.computername = wargs (0)
    Call showem
    Else
    wscript.echo "Call script " & wscript.scriptfullname & " with a parameter to test collection from a remote machine."
    End If
    Set objHardware = nothing
    
    Sub ShowEm ()
    'On Error Resume Next
    strMsg = ""
    strMsg = strMsg & vbcrlf & "===== Computer = " &        objHardware.computername & " ====="
    strMsg = strMsg & vbcrlf & "Hardware Model = " & objHardware.Model
    strMsg = strMsg & vbcrlf & "Serial Number = " & objHardware.SerialNumber
    strMsg = strMsg & vbcrlf & "Type = " & objHardware.Type
    strMsg = strMsg & vbcrlf & "Asset Tag = " & objHardware.assetTag
    strMsg = strMsg & vbcrlf & "Manufacturer = " & objHardware.Manufacturer
    strMsg = strMsg & vbcrlf & "SuiteMask = " & objHardware.SuiteMask 
    strMsg = strMsg & vbcrlf & "OSCSD = " & objHardware.OSCSD 
    strMsg = strMsg & vbcrlf & "OSMajor = " & objHardware.OSMajor 
    strMsg = strMsg & vbcrlf & "OSMinor = " & objHardware.OSMinor 
    strMsg = strMsg & vbcrlf & "OSBuild = " & objHardware.OSBuild 
    strMsg = strMsg & vbcrlf & "OsEx = " & objHardware.OsEx 
    strMsg = strMsg & vbcrlf & "OSBootTime = " & objHardware.OSBootTime 
    strMsg = strMsg & vbcrlf & "OSInstallTime = " & objHardware.OSInstallTime 
    strMsg = strMsg & vbcrlf & "OSID = " & objHardware.OSID 
    strMsg = strMsg & vbcrlf & "OSStr = " & objHardware.OSStr 
    strMsg = strMsg & vbcrlf & "OSStrProductType = " & objHardware.OSStrProductType
    strMsg = strMsg & vbcrlf & "OSCurrentTimeZoneOffset = " & objHardware.OSCurrentTimeZoneOffset
    strMsg = strMsg & vbcrlf & "OSTimeZone = " & objHardware.OSTimeZone
    strMsg = strMsg & vbcrlf & "IPAddress = " & objHardware.IPAddress
    
    For each aDrive in objHardware.drives 
    strMsg = strMsg & vbcrlf & "Drive " & adrive.letter & " size " & adrive.size & " mb Freespace " & adrive.freespace & " mb"
    
    Next
    
    wscript.echo strMSg
    End Sub
    Last edited by tlhintoq; Oct 30 '09, 07:07 AM. Reason: [CODE] ...your code here...[/CODE] tags added
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      I can see no questions nor any attempt on your part to convert this.

      Should the volunteers here then assume you are putting this out for bids? Are you looking to hire someone to do this for you?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        vb.net and vbScript are fairly similar.
        Shouldn't be hard for you to convert.

        Comment

        Working...