it might be easier to run regedit.exe in silent mode with a registry file that contains the exact entries you want. You can set each computer to run it from a shared location so all you need to do is update the file and when the next scheduled run of regedit.exe runs on each computer, they get the new entries.
something like:
regedit.exe /S puttyentries.reg
In order to pull a registry key from one computer, you would use:
regedit.exe /E puttyentries.reg "registry_key"
There would probably be more elegant ways of automating the whole process using vbscript or autoit with remote read/write functions for the registry.
Here is an example with AutoIt that will sync every 30 minutes with a remote computer (caveat, I really haven't tested this):
While 1 ;loop indefinitely
$i1 = 1 ;set initial counter
While 1 ;loops through all sessions
$keyname = RegEnumVal("\\REMOTECOMPUTER\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions", $i1) ;reads session names
If @error <> 0 Then ExitLoop ;exits when no more sessions exist
$i2 = 1 ;set initial counter
While 1 ;loops through all value in key until done
$valuename = RegEnumVal("\\REMOTECOMPUTER\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions" & "\" & $keyname, $i2) ;read value name from remote machine
If @error <> 0 Then ExitLoop ;errors and escapes when no more values to read
$type = @extended ;sets registry value type
$value = RegRead("HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Session" & "\" & $keyname, $valuename) ;read value
RegWrite("HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Session" & "\" & $keyname, $valuename, $type, $value) ;write key value to local machine
$i2 = $i2 + 1 ;increment by 1
WEnd
$i1 = $i1 + 1 ;increment by 1
WEnd
Sleep(1800000) ;sleep 30 min
WEnd
I have a little idea for something... Can you tell me the exact path of the putty registry keys you want? I am going out now but will be back in about an hour and will try to help further. – William Hilsum – 2011-08-25T17:57:47.777
@William Hilsum: It's
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY
. – Ram Rachum – 2011-08-25T18:32:01.9031Are these computers generally on the same network? Or do you want this to work remotely as well? – music2myear – 2011-08-25T19:22:16.573
@Ram Rachum Is that the same on both computers? – William Hilsum – 2011-08-25T19:25:06.700
2
If this is about Putty, Why not use portable putty? It stores the settings in a file. Sync your copies of Portable Putty via dropbox or whatever.
– Zoredache – 2011-08-25T19:42:50.203@William Hilsum: Yes. – Ram Rachum – 2011-08-25T19:48:09.967
@Zoredache: I checked PortablePutty out. Not bad, syncing a file would be more elegant. But I prefer to use the canonical PuTTY if possible. – Ram Rachum – 2011-08-25T19:53:09.430
@Ram Rachum, Portable putty IS the official version of putty. Download it and run a sha1sum of
PuTTYPortable\App\putty\PUTTY.EXE
. The sum you get is identical to the official version. The main binary is just doing the registry export/import stuff for you. – Zoredache – 2011-08-25T19:58:52.453@Zoredache: Just because the
putty.exe
file delivered by PortablePutty is identical to the original one doesn't mean it's the same program. For example, the portable version doesn't allow you to run side-by-side with the original version. It also doesn't include all the other utilities likepageant.exe
and others that come with Putty. – Ram Rachum – 2011-08-27T06:44:51.790