First confirm that you can run this commandline from the command shell cmd.exe:
Obviously modify to fit your needs:
echo thisismypassphrase | gpg --batch --passphrase-fd 0 --decrypt "C:\FILETODECRYPT.GPG"
Once you have a working commandline you can convert to a ShellExecute function.
;Sample Commandline
;echo thisismypassphrase | gpg --batch --passphrase-fd 0 --decrypt "C:\FILETODECRYPT.GPG"
;To explicitly run the 32-bit version of a command:
cmd_32 = DirWindows(0):"syswow64\CMD.EXE"
; To explicitly run the 64-bit version of a command:
cmd_64 = DirWindows(0):"sysnative\CMD.EXE"
DirChange('c:\tools\gpg\') ;Location of gpg.exe
ShellExecute(cmd_32, '/k echo thisismypassphrase | gpg.exe --batch --passphrase-fd 0 --decrypt "C:\FILETODECRYPT.GPG"', '', @NORMAL, '')
Exit