02-12-2026 12:42 PM
Hi,
I'm looking into seeing if Putty will be able to run some scripts on an C2960x switch. We currently will putty into the unit and type out several commands to either upgrade the IOS or downgrade them. What I looking to achieve is somehow create a script that will run to complete this process, instead of typing out line or line items.
Currently what I do is I copy and paste the commands into putty and go from there. Just looking for a way to automate this process so it will be easier if possible. I'm still learning about scripting so bear with me on this. Any help will be appreciated if this is possible.
02-12-2026 12:56 PM
There are many ways to achieve what you are looking for. Putty is a SSH client and used to type commands on the device. If you are planning to work with automated script, you are going to need to run the script from some OS. Usually Linux is the best for this purpose.
Use AI to build your script, if you are not experienced in coding, this will give you a starter. Just make to use it in a test environment first before going to production.
Practically everything can be automated on the cisco switch if you dedicate time to build the scripts accordingly
02-12-2026 01:27 PM
I have tried IOS XE with Python for Cat 9300
https://github.com/timo-juhani/lan_upgrade
but still below code helpfull for IOS code :
https://gist.github.com/kubsoo/39d9e72e035a131099a82bf3f577f985#file-upgrade_cisco-py
=====️ Preenayamo Vasudevam ️=====
***** Rate All Helpful Responses *****
02-12-2026 01:35 PM
Thanks, but I already have the command line items. I just need to figure out you to get the script to work.
02-12-2026 01:55 PM
Check the upgrade IOS, that script has all the information.
=====️ Preenayamo Vasudevam ️=====
***** Rate All Helpful Responses *****
02-13-2026 06:05 AM
putty does not have such an option!
the best that you can do is a single command : https://documentation.help/putty/using-cmdline-m.html
With some servers (particularly Unix systems), you can even put multiple lines in this file and execute more than one command in sequence, or a whole shell script; but this is arguably an abuse, and cannot be expected to work on all servers. In particular, it is known not to work with certain ‘embedded’ servers, such as Cisco routers.
-> you need another terminal emulator (or tool) that can read multiple commands from a file
and preferably has the possibility to handle error-responses
02-16-2026 08:11 AM
This isn't exactly what you were asking, but you can collapse the pasted commands to putty down to a single line if the commands are exactly the same. You could put them in a file on an HTTP(S) server and use:
copy http://[server]/mycommands.txt run
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide