Hello,
i Need help
Windows 7
i Need to write a Batch or script with the following
the script or Batch must open com port 7
and send the command 52 (Dec) or 0x34 (hex )and Close the script
thanks for your help
Batch script to send characters to a serial port
Moderator: DosItHelp
Re: Batch script to send characters to a serial port
On windows 7 the mode function has these parameters: https://technet.microsoft.com/de-de/library/cc732236(v=ws.10).aspx#BKMK_1
You have to set the attributes that meets your system specification.
After that you can use the com port as follows:
1) Create a data file, that contains what you want to send, and
2) then copy the file content to the com device of your choice
So the resulting batch file should be similar to this:
penpen
You have to set the attributes that meets your system specification.
After that you can use the com port as follows:
1) Create a data file, that contains what you want to send, and
2) then copy the file content to the com device of your choice
So the resulting batch file should be similar to this:
Code: Select all
:: the next line must be edited to your requirements
mode com<M>[:] [baud=<B>] [parity=<P>] [data=<D>] [stop=<S>] [to={on|off}] [xon={on|off}]
:: prepare file data.bin
<nul >"data.bin" set /P "=4"
:: copy to console device (edit com<M> to meet your requirements)
copy /b "data.bin" /b com<M> /b
penpen