Code Monkey home page Code Monkey logo

Comments (16)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
it appears that SuperPutty "sessions" are different from vanilla putty 
connection sessions. "import sessions" refers to importing SuperPutty sessions, 
not vanilla putty sessions.

without the ability to import my long list of existing vanilla putty 
connections, export/import of SuperPutty sessions is VERY much putting the cart 
before the horse.

Why not read the existing vanilla putty sessions from the registry?

Original comment by chiposaur on 16 Jun 2010 at 3:04

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
Hmm.. yeah, I got to the same end. Here is what you can do: 
- create only one connection and export it so you have a sample;
- use a regular text editor (other than notepad) and make the entries on one 
line so it is easier to edit;
- find all your putty connections from the registry using:
   reg query HKCU\Software\SimonTatham\Putty\Sessions
Using the information, edit the sample.xml, creating a new line for each of 
your connections.

Note that the element <PuttySession>whatever entry</PuttySession> *has* to 
match whatever entry you have on your putty configurator so SuperPutty will use 
the settings from putty and you'll have your window as expected (otherwise, a 
black&white window will be seen)

Works for small number of connections (I have less than 10) but for large 
numbers, you have to be creative with the editing. Best is to find a text 
editor that is capable of column selection/copy/paste, which seems a feature 
remarkably under-explored.

I have attached a sample with one entry, just in case anyone is interested. You 
have to copy/past the same line over and over and modifying it.

When you have your .xml, import it back in SuperPutty (works like a charm).

-Alex

Original comment by [email protected] on 17 Jun 2010 at 9:57

Attachments:

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
this can be work around. and its okay to do this activity if have 5 10 
connection. I have almost 30 40 connection. and making importable xml file with 
all required details is not good efforts :( 

Original comment by [email protected] on 18 Jun 2010 at 5:24

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
how about this for crazy. . . i had considered using this program and 
discovered i couldn't import my list of sessions... only to come around here 
that i'd been here before looking for an answer to the exact same lack of 
developer foresight. pretty discouraging.

Original comment by chiposaur on 18 Jan 2011 at 12:55

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
Yes, this is the FIRST thing I looked for as well because I have ~100 putty 
sessions saved in the registry, I guess I can write a perl script to take the 
putty registry settings and put them in the xml format for SuperPuTTY. IF I do 
that i'll post the script here.

Original comment by [email protected] on 1 Feb 2011 at 12:52

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
This script will output a list of the putty sessions by ip address (sorry no 
names) into a properly formatted XML file for suuperputty import.

This script needs the following file in the same directory:

 The registry entries for putty saved as a txt file named registry.txt  

#!/usr/bin/sh -vx

echo '<?xml version="1.0" encoding="utf-8"?>
<ArrayOfSessionData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  ' > superputty-session-list.xml

grep rsa2@22 registry.txt  | awk -F : '{print $2}' | awk -F \" '{print $1}' |  
while read IP

do

echo $IP

echo '<SessionData> <SessionName>'$IP'</SessionName> <Host>'$IP'</Host> 
<Port>22</Port> <Proto>SSH</Proto> <PuttySession>myhostname 
console</PuttySession> <Username>root</Username> <LastPath>.</LastPath> 
<LastDockstate>Document</LastDockstate> 
<AutoStartSession>false</AutoStartSession> </SessionData> 

' >> superputty-session-list.xml

done

echo "</ArrayOfSessionData>" >> superputty-session-list.xml


Original comment by [email protected] on 1 Feb 2011 at 2:26

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
there is a new version of superputty, which can import existing putty sessions
try that.

Original comment by [email protected] on 5 May 2011 at 7:46

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
to save the time of anyone following this thread, there is no new version of 
superputty. the only download available is from 2009.

[email protected] if you meant something else, then you should link it.

Original comment by chiposaur on 5 May 2011 at 1:51

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
I think this is what vikasch means: https://github.com/phendryx/superputty

Original comment by [email protected] on 6 May 2011 at 8:34

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
Hereby a (non-perl) command script to export and process puTTY 0.60 registry 
sessions into a superPuTTY XML import format. Given that the new code now has 
import, this is primarily useful for transferring configurations from other 
systems.

The script is fragile (if you cancel midway, the shell session's variables get 
corrupted...) but it's tested and confirmed working with the old (pre3) and the 
new (1.0.3) superPuTTY code on both XP and Vista/windows 7.

Usual absence of any warranty applies. Lots of tricks used as you can see. I 
won't spend any more time on this one. 
Usage:
1) copy the text between the lines or use the attached txt file. save it to 
your desktop as putty_export.cmd and then double-click it, or call it from a 
command line.

The produced file will end up in your %HOMEPATH% if run from the desktop. 
change OUTPUT to suit if that's undesirable.

--- COPY BELOW THIS LINE ---
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
IF NOT DEFINED REPLACEME (
REM This IF statement works around a misinterpreation of the %20, enabling 
conversion to a space.
 SET REPLACEME=@
 CALL %0 !REPLACEME! !REPLACEME!
 EXIT /B
)

GOTO :START
REGKEY_BASE=HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\ (54 chars)

:START
SET OUTPUT=.\puttyconfig.xml
SET COUNTER=0
REM These entries are for shortcircuiting purposes.
SET IS_HostName=SERVER_IP
SET IS_Protocol=PROTOCOL
SET IS_PortNumber=PORT
SET IS_UserName=USER_NAME

SET REG=reg query HKCU\Software\SimonTatham\PuTTY\Sessions /s
CALL :PREP_OUTPUT
ECHO Beginning export and processing...
FOR /F "tokens=1,2,3*" %%a IN ('%REG%') DO (
 CALL :PARSE_VAR "%%a" "%%b" "%%c"
)
REM we write the last entry if any have been found at all.
IF DEFINED PUTTYSESSION CALL :WRITE_ENTRY
ECHO ...finished processing %COUNTER% entries.
CALL :FINISH_OUTPUT
GOTO :EOF


REM %2 has overlap with %20, which should be a space, so we remap to work 
around this.
REM %1, -%2, %3, %4
:PARSE_VAR
IF "%~1"=="" GOTO :EOF
SET V=%~1
IF "%V:~0,4%"=="HKEY" (GOTO :IF_NEWENTRY) ELSE (GOTO :IF_NEWVALUE)
:IF_NEWENTRY
    IF DEFINED PUTTYSESSION (CALL :WRITE_ENTRY) ELSE (ECHO Looking for first entry...)
    SET PUTTYSESSION=%V:~54%
    IF DEFINED PUTTYSESSION SET PUTTYSESSION=!PUTTYSESSION:@0= !
GOTO :EOF
:IF_NEWVALUE
    SET VAR_NAME=%~1
    IF NOT DEFINED IS_!VAR_NAME! GOTO :EOF
    IF NOT "%~2"=="" SET VAR_TYPE=%~2
    REM IF NOT "%~3"=="" (
        IF "%VAR_TYPE%"=="REG_DWORD" (SET /A VAR_VALUE=%~3 + 0) ELSE (SET VAR_VALUE=%~3)
    REM )
    CALL :SET_!VAR_NAME!
GOTO :EOF

:SET_HostName
SET SERVER_IP=%VAR_VALUE%
GOTO :EOF

REM we have specific adjustments as the old SuperPuTTY is  a little 
case-oversensitive for protocol types...
:SET_Protocol
IF /i "%VAR_VALUE%"=="telnet" SET PROTOCOL=Telnet
IF /i "%VAR_VALUE%"=="raw" SET PROTOCOL=Raw
IF /i "%VAR_VALUE%"=="rlogin" SET PROTOCOL=Rlogin
IF /i "%VAR_VALUE%"=="serial" SET PROTOCOL=Serial
IF /i "%VAR_VALUE%"=="ssh" SET PROTOCOL=SSH
REM SET PROTOCOL=%VAR_VALUE%
GOTO :EOF

:SET_PortNumber
SET PORT=%VAR_VALUE%
GOTO :EOF

:SET_UserName
SET USER_NAME=%VAR_VALUE%
GOTO :EOF

:PREP_OUTPUT
IF EXIST %OUTPUT% copy %OUTPUT% %OUTPUT%-old.xml
ECHO ^<?xml version="1.0" encoding="utf-8"?^>> %OUTPUT%
ECHO ^<ArrayOfSessionData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"^>>> %OUTPUT%
GOTO :EOF

:WRITE_ENTRY
SET /A COUNTER=%COUNTER% + 1
ECHO saving !PUTTYSESSION! ...
ECHO   ^<SessionData^>>> %OUTPUT%
ECHO    ^<SessionName^>%PUTTYSESSION%^</SessionName^>>> %OUTPUT%
ECHO    ^<Host^>%SERVER_IP%^</Host^>>> %OUTPUT%
ECHO    ^<Port^>%PORT%^</Port^>>> %OUTPUT%
ECHO    ^<Proto^>%PROTOCOL%^</Proto^>>> %OUTPUT%
ECHO    ^<PuttySession^>%PUTTYSESSION%^</PuttySession^>>> %OUTPUT%
IF DEFINED USER_NAME (ECHO    ^<Username^>%USER_NAME%^</Username^>>> %OUTPUT%) 
ELSE (ECHO    ^<Username^>^</Username^>>> %OUTPUT%)
ECHO    ^<LastPath^>.^</LastPath^>>> %OUTPUT%
ECHO    ^<LastDockstate^>Document^</LastDockstate^>>> %OUTPUT%
ECHO    ^<AutoStartSession^>false^</AutoStartSession^>>> %OUTPUT%
ECHO   ^</SessionData^>>> %OUTPUT%
GOTO :EOF

:FINISH_OUTPUT
ECHO ^</ArrayOfSessionData^>>> %OUTPUT%
GOTO :EOF
--- COPY ABOVE THIS LINE ---

Original comment by [email protected] on 9 May 2011 at 7:18

Attachments:

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
The "File >> Copy PuTTY Sessions" Menu task works on SuperPutty 1.0.3.  Thanks!

Original comment by [email protected] on 28 Jun 2011 at 5:17

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
This option "File >> Copy PuTTY Sessions" is missing from the latest 1.2 
version.

Original comment by [email protected] on 25 Apr 2012 at 6:53

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
Issue 93 has been merged into this issue.

Original comment by [email protected] on 13 May 2012 at 4:48

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
New release will have

File -> Import Sessions -> From PuTTY settings

Sessions will be put into a folder named, ImportFromPutty.

Original comment by [email protected] on 13 May 2012 at 4:49

  • Changed state: Accepted

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
v1.2.0.7

Original comment by [email protected] on 14 May 2012 at 10:33

  • Changed state: Fixed

from superputty.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
To Import your superputty sessions, the below file has all of your putty 
sessions, Copy this file 
C:\Users\<YourUserName>\Documents\SuperPuTTY\Sessions.XML to whereever you want 
to. 

Original comment by [email protected] on 29 May 2013 at 6:09

from superputty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.