Hello,
Yes, I've Googled and so on, but am a bit stuck. This is actually my
first vbscript. The goal is to manage GPG encryption/decryption of
files from a script, which will eventually be a function of a larger
script. The script below is my attempt at getting this working. The
first WshShell.Exec works but the second does not (the first one may
wrap). I'm sure it's something simple.
---
Option Explicit
'Declare the variables
Dim WshShell, oExec
Dim GPGPTFName
Dim GPGRecip
'Define the variables
GPGPTFName = "c:\gnupg\test.txt" 'GPG plain-text filename
GPGRecip = "someone@somedomain.com" 'GPG recipient
'Define the constants
Const GPGEncrypt = "C:\gnupg\gpg.exe -e -r" 'GPG command to encrypt
Const GPGDecrypt = "C:\gnupg\gpg.exe -d" 'GPG command to decrypt
'Invoke the WScript Shell Object
Set WshShell = WScript.CreateObject ("WScript.Shell")
WshShell.Exec "C:\gnupg\gpg.exe -e -r someone@somedomain.com
c:\gnupg\test.txt"
WshShell.Exec (GPGEncrypt & GPGRecip & GPGPTFName)
---
Also, please bear in mind that I will eventually need to capture an exit
status and error out to a mail function (with the reason why it failed),
if it fails. All help appreciated.