Last active
August 29, 2015 14:27
-
-
Save steelywing/48f965650dc3cf5030a3 to your computer and use it in GitHub Desktop.
Revisions
-
steelywing revised this gist
Aug 22, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ InstallDir "$TEMP" RequestExecutionLevel user SilentInstall silent Section SetOutPath $INSTDIR File "putty.exe" File "putty-serial.vbs" -
steelywing revised this gist
Aug 22, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ # Wrap putty-serial.vbs to exe Name "PuTTY Serial" Icon "putty.ico" -
steelywing revised this gist
Aug 22, 2015 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ Name "PuTTY Serial" Icon "putty.ico" OutFile "putty-serial.exe" InstallDir "$TEMP" RequestExecutionLevel user SilentInstall silent Section # Create Shortcut SetOutPath $INSTDIR File "putty.exe" File "putty-serial.vbs" ExecShell "" '"$TEMP\putty-serial.vbs"' SectionEnd -
steelywing revised this gist
Aug 22, 2015 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ Const PUTTY_PATH = "putty" ' Return array of serial port number Function getCOM() Dim fso, com() ReDim com(-1) @@ -30,7 +33,7 @@ If UBound(com) = -1 Then End If If UBound(com) = 0 Then CreateObject("WScript.Shell").Exec(PUTTY_PATH & " -serial COM" & com(0)) WScript.Quit End If @@ -39,7 +42,7 @@ For i = 0 to UBound(com) Dim answer answer = WshShell.Popup("Use COM" & com(i) & " ?", , "COM port", 4 + 32) If answer = 6 Then CreateObject("WScript.Shell").Exec(PUTTY_PATH & " -serial COM" & com(i)) WScript.Quit End If Next -
steelywing revised this gist
Aug 22, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,6 +31,7 @@ End If If UBound(com) = 0 Then CreateObject("WScript.Shell").Exec("putty -serial COM" & com(0)) WScript.Quit End If ' COM more than 1 -
steelywing created this gist
Aug 22, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ Function getCOM() Dim fso, com() ReDim com(-1) Set fso = CreateObject("Scripting.FileSystemObject") For i = 1 To 20 Dim f, found On Error Resume Next Set f = fso.OpenTextFile("COM" & i & ":", 2) ' Err.Clear found = (Err.Number = 0) f.Close On Error Goto 0 If found Then ReDim Preserve com(UBound(com) + 1) com(UBound(com)) = i End If Next getCOM = com End Function Dim WshShell, com Set WshShell = WScript.CreateObject("WScript.Shell") com = getCOM() If UBound(com) = -1 Then WScript.Echo "No COM found" WScript.Quit End If If UBound(com) = 0 Then CreateObject("WScript.Shell").Exec("putty -serial COM" & com(0)) End If ' COM more than 1 For i = 0 to UBound(com) Dim answer answer = WshShell.Popup("Use COM" & com(i) & " ?", , "COM port", 4 + 32) If answer = 6 Then CreateObject("WScript.Shell").Exec("putty -serial COM" & com(i)) WScript.Quit End If Next