• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1587
  • Last Modified:

Using PuTTY in Windows with Notepad

I'm trying to set up a debug in a Juniper SRX-240.
Because of the many commands, I'd rather not type them all into the CLI directly.
So, I have them all in a text file that I'd like to copy and paste.

Up to now I've been able to do this:
Windows Copy the textblock (multiple lines) from Notepad.
Right click in the PuTTY window at the cursor.

Lately the following has been happening:
Blank spaces between command terms are being removed.

I've tried using the Windows-style option in PuTTY so I can see a menu and Paste.  But this seems to make no difference.

What can I do to make this work as intended?
Fred Marshall
Fred Marshall
4 Solutions
Use plink with your commands file.

The command line tool plink is part of the PuTTY suite. Get it from here:


Once you installed it just run from a CMD window

plink -m commandsfile.txt user@server

A plink manual is here:


You could be better off using another editor like notepad++ where you can set the encoding to be something used commonly on 'nix platforms:

Fred MarshallPrincipalAuthor Commented:
OK, done.  
What encoding might you suggest then?
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

Fred MarshallPrincipalAuthor Commented:
Just to be clear:  These are primarily interactive sessions but there are a number of commands that are each fairly long and slightly complex so the issue of typos and editing is to be dealt with.  Thus a source of text to be pasted into the PuTTY window that can be edited "offline" is a pretty good way to do this.  But the pasting can't be changing the text of course!

it is a link from Cisco support form .it showing hyper terminal .But it may be help you.

Probably UTF-8 will do, just try the different options.
There should be no issues with using notepad or any other editor, my guess is that the issues you are having might deal with whether the commands you want to send and the way it is laid out in notepad might be an issue.
You may have to transition into the correct mode before you send the mode specific commands.

If memory servers, you can predefine and leave the restrictive lists. Then all your debug commands will be which list to use to limit what is debugged.
Fred MarshallPrincipalAuthor Commented:
Well the SRX seems to allow some predefinitions but I don't see that they apply to groups; only individual settings.  At least that's what I get so far.

I'm beginning to think that something "lost its mind" for a while because now it appears that I can accomplish the same thing once more.  Also, there could have been "cockpit error" in that if one is not in the proper MODE in the CLI (one mode shows you things and the other mode allows changes to settings) then the commands can mean nothing at all and there appears to be some automatic "hint" system that runs things all together.  If you put in a bad command then a whole bunch of commands get "tried" for your consideration is how I'm interpreting what I'm seeing.
Fred MarshallPrincipalAuthor Commented:
Arnold appears to have addressed the issue.  Thanks and points to others who made useful suggestions - although unneeded in this case.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now