VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the serial port configuration using Win32_SerialPortConfiguration WMI Class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Wed 11th February 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get the serial port configuration using Win32_SerialPortConfiguration WMI Class

Rate Get the serial port configuration using Win32_SerialPortConfiguration WMI Class



'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik

On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_SerialPortConfiguration.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_SerialPortConfiguration Class by Karthikeyan"
TextFile.WriteLine 
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_SerialPortConfiguration",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
    TextFile.WriteLine "AbortReadWriteOnError: " & SubItems.AbortReadWriteOnError
    TextFile.WriteLine "BaudRate: " & SubItems.BaudRate
    TextFile.WriteLine "BinaryModeEnabled: " & SubItems.BinaryModeEnabled
    TextFile.WriteLine "BitsPerByte: " & SubItems.BitsPerByte
    TextFile.WriteLine "Caption: " & SubItems.Caption
    TextFile.WriteLine "ContinueXMitOnXOff: " & SubItems.ContinueXMitOnXOff
    TextFile.WriteLine "CTSOutflowControl: " & SubItems.CTSOutflowControl
    TextFile.WriteLine "Description: " & SubItems.Description
    TextFile.WriteLine "DiscardNULLBytes: " & SubItems.DiscardNULLBytes
    TextFile.WriteLine "DSROutflowControl: " & SubItems.DSROutflowControl
    TextFile.WriteLine "DSRSensitivity: " & SubItems.DSRSensitivity
    TextFile.WriteLine "DTRFlowControlType: " & SubItems.DTRFlowControlType
    TextFile.WriteLine "EOFCharacter: " & SubItems.EOFCharacter
    TextFile.WriteLine "ErrorReplaceCharacter: " & SubItems.ErrorReplaceCharacter
    TextFile.WriteLine "ErrorReplacementEnabled: " & SubItems.ErrorReplacementEnabled
    TextFile.WriteLine "EventCharacter: " & SubItems.EventCharacter
    TextFile.WriteLine "IsBusy: " & SubItems.IsBusy
    TextFile.WriteLine "Name: " & SubItems.Name
    TextFile.WriteLine "Parity: " & SubItems.Parity
    TextFile.WriteLine "ParityCheckEnabled: " & SubItems.ParityCheckEnabled
    TextFile.WriteLine "RTSFlowControlType: " & SubItems.RTSFlowControlType
    TextFile.WriteLine "SettingID: " & SubItems.SettingID
    TextFile.WriteLine "StopBits: " & SubItems.StopBits
    TextFile.WriteLine "XOffCharacter: " & SubItems.XOffCharacter
    TextFile.WriteLine "XOffXMitThreshold: " & SubItems.XOffXMitThreshold
    TextFile.WriteLine "XOnCharacter: " & SubItems.XOnCharacter
    TextFile.WriteLine "XOnXMitThreshold: " & SubItems.XOnXMitThreshold
    TextFile.WriteLine "XOnXOffInFlowControl: " & SubItems.XOnXOffInFlowControl
    TextFile.WriteLine "XOnXOffOutFlowControl: " & SubItems.XOnXOffOutFlowControl
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_SerialPortConfiguration.txt",1,True


Download this snippet    Add to My Saved Code

Get the serial port configuration using Win32_SerialPortConfiguration WMI Class Comments

No comments have been posted about Get the serial port configuration using Win32_SerialPortConfiguration WMI Class. Why not be the first to post a comment about Get the serial port configuration using Win32_SerialPortConfiguration WMI Class.

Post your comment

Subject:
Message:
0/1000 characters