I have found the simple VBscript code in some old posts that worked for most:
Const ForReading = 1 Const ForWriting = 2 Set fso = CreateObject("Scripting.FileSystemObject") Set com = fso.OpenTextFile("COM6:9600,N,8,1", ForReading) s = com.ReadLine MsgBox(s) com.Close()
The issue is that if I plug Arduino Uno to my PC and run a script, the script get stuck at: s = com.ReadLine
If I just open and close Serial Monitor in Arduino IDE and then run VBS after, it runs every time.
I have tried adding delays after each command with WScript.Sleep(500) but it did't work. I tried it on different computers but the same happened. For testing I am using Examples/Basic/AnalogReadSerial sketch.
The goal for this script is to get current value of temperature sensor from Arduino to PC software, which only support external variables from VBS.
I will expand VBS later to be sure it catches something usefull if I can get communication to work.
I would be realy happy for any solutions since I am stuck with this for a few days.