I am trying to run a set of show commands on a Cisco switch using PuTTY on Windows.
I am not able to use anything other than putty.exe
(no Plink, expect
, anything!).
I am running the following command in an elevated PowerShell window:
c:\temp\switches\putty.exe -load "cisco" -ssh IPADDRES -l username -pw password -m C:\temp\ciscoCMDs.txt
*The "Cisco" configuration just sets it so it logs the console window to a text file.
The contents of the ciscoCMDs.txt
are as follows:
show version
show vlan
When I run the command in an elevated PowerShell window PuTTY launches and says:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log IPADDRESS 11:58:44 =~=~=~=~=~=~=~=~=~=~=~= Using username "Username".
Line has invalid autocommand "show version show vlan"
If I place a !
at the end of first line...
show version !
show vlan
It runs the show version
command, but does not run the show vlan
command.
How can I get the second command to run? (I intend on placing several more commands there, but if the second command can run there should be no reason the third... nth... wont run.)
Is there a configuration in the PuTTY profile I need to set up for End of File or End of Line?
Is there a special character I need to add at the end of the line to make it so it knows a second command is coming?
Just to be crystal clear:
- I am only able to use PuTTY and SSH to access a Cisco switch.
- I can not use any other files or programs other than
putty.exe
, the SSH connection, and thecommands.txt
files housing a list of commands.- I would like to run multiple show commands from one .txt file and have the output of the commands logged using a single PuTTY profile and a single command run via PowerShell.