Run Putty with the -pw option

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
CarPiotr
Posts: 40
Joined: 11 Dec 2019, 08:21

Run Putty with the -pw option

Post by CarPiotr » 17 Nov 2020, 08:32

Will you help a less experienced colleague?
In Gui, I enter a password and run Putty with that password.
Simple applet but probably not for me yet.
My login is saved in the putty "mine" session

Code: Select all

Gui Color, 0x3299CC, 0xADEAEA,
Gui Font, s10 Bold 
Gui Add, Edit, hWndhEdtValue x20 y5 w200 h22 -E0x200 vPass +Password +Center -VScroll
SendMessage 0x1501, 1, "Password",,ahk_id %hEdtValue%
Gui, Add, Button, X50 y30 w100 h22 GBut, Putty

Gui, +Hwndgui_id
Gui Show, x800 y200 w250 h100, TEST
Gui, Submit, Nohide
Return

GuiClose:
ExitApp


But:

run, c:\Program Files\Putty\putty.exe -load mine -pw %Pass%

Return

User avatar
boiler
Posts: 17404
Joined: 21 Dec 2014, 02:44

Re: Run Putty with the -pw option

Post by boiler » 17 Nov 2020, 08:35

You need to put Gui, Submit, Nohide as the first line of your But: routine so it captures the password entered. You have it immediately after the GUI is displayed which captures it while the entry is blank.

CarPiotr
Posts: 40
Joined: 11 Dec 2019, 08:21

Re: Run Putty with the -pw option

Post by CarPiotr » 17 Nov 2020, 08:56

Why am I always looking for bigger problems and not the basic ones. Thanks

Post Reply

Return to “Ask for Help (v1)”