LOCAL lsProcessInfo as String,; lsStartupInfo as String,; lnResult as Integer,; lnProcessHandle as Integer,; lhndStartedProcess as Integer DECLARE LONG WaitForSingleObject IN WIN32API; LONG hHandle,; LONG dwMilliseconds DECLARE LONG CreateProcessA IN WIN32API AS "CreateProcess"; STRING lpApplicationName,; STRING lpCommandLine,; LONG lpProcessAttributes,; LONG lpThreadAttributes,; SHORT bInheritHandles,; LONG dwCreationFlags,; STRING lpEnvironment,; STRING lpCurrentDirectory,; STRING lpStartupInfo,; STRING lpProcessInformation DECLARE LONG CloseHandle IN WIN32API; LONG hObject lsProcessInfo = REPLICATE(CHR(0), 16) lsStartUpInfo = CHR(68) + ; REPLICATE(CHR(0), 43) + ; CHR(1) + ; REPLICATE(CHR(0), 23) THIS.WriteStringToLog("Copying Files for Encryption...") COPY FILE (ADDBS(THIS.m_sOutputLocation) + "PRI_074.txt") TO "C:\PRI_074.TXT" THIS.WriteStringToLog("Beginning Encryption") lnResult = CreateProcess(0, ; && NULL '"C:\program files\gnupgp\gpg" --batch --yes -e -r MyKeyName -o ' +; '"c:\PRI_074.asc" "C:\PRI_074.txt"' + CHR(0), ; 0,; 0,; 0,; 0,; 0,; "C:\"+CHR(0),; @lsStartUpInfo,; @lsProcessInfo) IF lnResult = 1 * CreateProcess() started our app, but we have to wait until it finishes loading * Strip the process handle from the PROCESS_INFORMATION structure lhndStartedProcess = (((ASC(SUBSTR(lsProcessInfo, 4, 1)) * 256) + ; ASC(SUBSTR(lsProcessInfo, 3, 1))) * 256 + ; ASC(SUBSTR(lsProcessInfo, 2, 1))) * 256 + ; ASC(LEFT(lsProcessInfo, 1)) * As long as the other process exists, wait for it WaitForSingleObject(lhndStartedProcess, 0xFFFFFFFF) CloseHandle(lhndStartedProcess) COPY FILE "C:\PRI_074.ASC" TO (ADDBS(THIS.m_sOutputLocation) + "PRI_074.gpg") DELETE FILE "C:\PRI_074.TXT" DELETE FILE "C:\PRI_074.ASC"One thing I did find out (about GPG it may not apply to PGP) is that it does not like long path names.