user3812823
user3812823

Reputation: 41

send commands to serial port using putty and .bat file

I would like to send following AT commands automatically by creating a .bat file using PuTTy.

AT

ok

AT+CPIN = 1234

ok

I can do it manually so far. But I would like to do it automatically by executing the above commands by just clicking on a batch file. Can someone please help me with the commands to prepare my .bat file? Thanks in advance!

Upvotes: 4

Views: 17096

Answers (1)

cure
cure

Reputation: 2688

try something like this:

commands.bat:

@echo off
echo AT
timeout /t 1 /nobreak >nul 2>&1
echo AT+CPIN = 1234
timeout /t 1 /nobreak >nul 2>&1
pause >nul 2>&1

send.bat:

commands.bat | putty -load test

where send.bat and commands.bat are in the same directory, and you execute send.bat

Upvotes: 2

Related Questions