Skip to content

Instantly share code, notes, and snippets.

@crozone
Created May 11, 2023 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crozone/26f35f26106c0c4b48011989df8b8635 to your computer and use it in GitHub Desktop.
Save crozone/26f35f26106c0c4b48011989df8b8635 to your computer and use it in GitHub Desktop.
Open all serial ports in PuTTY
# Powershell script to automatically open a putty window for each serial port on the computer
param (
[string]$baud = "115200"
)
$serialreg = Get-Item -Path Registry::HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
foreach ($thisname in $serialreg.GetValueNames())
{
$thisvalue = $serialreg.GetValue($thisname)
# Ignore Bluetooth virtual serial ports
if($thisname.StartsWith("\Device\Bt")) {
Write-Host "IGNORE "$thisname $thisvalue
continue
}
Write-Host "OPEN" $thisname $thisvalue
putty -sercfg $baud,8,n,1,N -serial $thisvalue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment