How to use password from the parameter

Kuifje kuifje_007 at
Wed Jan 27 13:10:07 CET 2010

I have a function from FoxPro. If you type Gpg( 'test.pgp',
'SecretPassword'), how can you make sure ShellExecute decrypt the pgp-file
with the password?

cParameters = [-d -o &sUitvoer &sInvoer ] works well but you have to give
the password in a DOS-window and it seems some users doesn't know how
because you cannot see the password.
I tried everything something like cParameters = [--&sPassWord-fd 0 -d -o
&sUitvoer &sInvoer ] but it doesn't work.

Do you know how to use the password into ShellExecute?

PROCEDURE Gpg( sInvoer, sPassWord)


IF EMPTY(sInvoer)
	CD aangeleverd
	sInvoer = GETFILE('pgp')
	CD ..

sUitvoer = SUBSTR(sInvoer, 1, LenTR(sInvoer) - 3) + 'zip'

	INTEGER nWinHandle, ;
	STRING cOperation, ;
	STRING cFileName, ;
	STRING cParameters, ;
	STRING cDirectory, ;
	INTEGER nShowWindow

nHwnd = 0
cOperation = 'open'
cFileToExecute = 'gpg.exe'
*cParameters = [-d -o &sUitvoer &sInvoer ]
cParameters = [--&sPassWord-fd 0 -d -o &sUitvoer &sInvoer ]
cDirectory = 'C:\Program Files\GNU\GnuPG\'
nShowWindow = 3

nError = ShellExecute( nHwnd, ;
	m.cOperation, m.cFileToExecute, m.cParameters, m.cDirectory, m.nShowWindow

WAIT "Druk op ENTER nadat je het wachtwoord hebt ingevoerd"
RUN /N c:\program files\7-zip\7z.exe e &sUitvoer -o&sAangeleverdMap 

View this message in context:
Sent from the GnuPG - User mailing list archive at

More information about the Gnupg-users mailing list