Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PuTTY command line automate serial commands from file

I am trying to connect to a serial port and send a series of commands from a file.

Firstly I have mananged to connect via the following:

PuTTY.exe -serial COM3 -sercfg 57600,8,n,1,N

E.g. I have a file called commands.txt with a series of serial commands I wished to be sent.

I tried the following however it failed to work:

PuTTY.exe -serial COM3 -sercfg 57600,8,n,1,N -m commands.txt

Any help is greatly appreciated.

like image 914
Rob Avatar asked Sep 25 '22 09:09

Rob


1 Answers

Try like this :

for /f "delims=" %%a in ('type commands.txt') do PuTTY.exe -serial COM3 -sercfg 57600,8,n,1,N -m %%a
like image 198
SachaDee Avatar answered Oct 03 '22 06:10

SachaDee