Return to site

Putty Serial Batch File

broken image


Putty, the Command Line and NO clicky clicky. Program FilesPuTTY>putty.exe -serial com4 -sercfg 115200. PuTTY/Cygwin Tutorial By Ben Meister. When you start PuTTY in the future. You'll probably want to save the connection info. Serial Scripting with Putty. Close & re-open putty serial port. Is it possible to send the content of text file over PuTTY over serial port. Serial Port communication - PuTTY emulation.

File

Serial Batch Number Pax

Active5 years, 6 months ago

I have a batch file that opens putty just fine.c:putty.exe root@192.168.12.34 -pw boyhowdy. But to make this work for me I need to understand how to include a script of a command so it will run under the putty tool. Like mount –o remount,rw / . Or is this something I can do with a tool called pscp. I am a nube to these tools and really could use some guideance. I have a bunck of these scripts and would really like to automate them. Thankyou

Putty Batch File Commands

user3314404user3314404

1 Answer

  1. If your goal is to execute shell commands remotely through putty, you should probably look at plink (putty without the gui, in other words an ssh client for windows) and then apply the standard here-doc techniques to plink.

  2. plink is part of the putty collection and is also downloadable from the same page as putty.

  3. If you want to execute a local script you would use

    plink user@host -m local_script.sh

  4. For instance. Assuming you're running on some Windows box (fyi the putty suite also runs on Linux) and want to execute a batch of commands on some remote box you would create a shell script on your local machine (say mount.sh) and run it like this:

  5. Also, it's probably better to copy your public key over so that the password is not coded in some batch file.

  6. Finally, be aware that not all environment variable defined in an interactive shell process will be available in the remote shell process. You might need to 'source' some profile script at the beginning of your script.

Alain PannetierAlain Pannetier

Batch File Samples

7,78322 gold badges3333 silver badges4444 bronze badges
Got a question that you can't ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Download Batch File

Not the answer you're looking for? Browse other questions tagged batch-fileputtypscp or ask your own question.





broken image