I use this script in combination with Total commander and/or Winrar.
If you have more files to extract with the same password, this script will automatically enter the last password - there is a timeout and a basic "wrong pwd" detection.
Code:
; http://monschein.org
;
#SingleInstance
#NoEnv
#Persistent
timeoutval := 120 ;forget password after x sec.
Menu, tray, add
Menu, tray, add, Change password, Submenu
Gui,Add,Text,w300,Enter password
Gui,Add,Edit,w300 r1 vMyEdit
Gui, Add, Button, Default, OK
Gui, Show
Gui, Hide
SetTimer,Check,500
timeoutval := timeoutval * -1000
return
Submenu:
Gui, Show
return
ButtonOK:
Gui, Submit
SetTimer,Check,500
return
Clear:
timeout := true
return
Check:
IfWinActive, Enter password ;winrar pwd window title
{
if (MyEdit = "" || timeout) {
; GuiControl,,MyEdit,%Clipboard%
SetTimer, Check, Off
Sleep,200
Gui, Show
timeout := false
return
}
else
{
timeout := false
SendInput {Raw}%MyEdit%
SendInput {Enter}
SetTimer,Clear,%timeoutval%
}
return
}
IfWinActive, Password required! ;total commander pwd window title
{
if (MyEdit = "" || timeout) {
; GuiControl,,MyEdit,%Clipboard%
SetTimer, Check, Off
Sleep,200
Gui, Show
timeout := false
return
}
else
{
timeout := false
SendInput {Raw}%MyEdit%
SendInput {Enter}
SetTimer,Clear,%timeoutval%
}
return
}
IfWinActive, Please purchase WinRAR license ;get rid of the shareware dialog
{
SendInput {Tab 2}{Enter}
return
}
IfWinActive, ahk_class #32770, Disk read ;total commander wrong pwd
{
MyEdit := ""
return
}
IfWinActive, ahk_class #32770, Error in ;total commander wrong pwd
{
MyEdit := ""
return
}
IfWinActive, WinRAR: Diagnostic messages ;winrar wrong pwd
{
MyEdit := ""
return
}