Is there a Windows command for opening serial ports, say COM3 via the command prompt in Windows 7? For example:
OPEN "COM6" AS #1
I cannot use pyserial or any other utilities that are not distributed with Windows 7.
Preferred solution Opening a COM port in QBasic on Windows 7
Maybe you can use the Powershell? It's included in Win7...
code taken from here http://blogs.msdn.com/b/powershell/archive/2006/08/31/writing-and-reading-info-from-serial-ports.aspx
Writing to a Serial Port
PS> [System.IO.Ports.SerialPort]::getportnames()
COM3
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.open()
PS> $port.WriteLine("Hello world")
PS> $port.Close()
Reading from a Serial Port
PS> $port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one
PS> $port.Open()
PS> $port.ReadLine()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With