You will need to be able to authenticate somehow from that program, either via a script that runs along-side the program or with the program itself. You will have to utilise the commandline options that come with netshare. The --unlock switch springs to mind:
The --unlock command prepares access to files/folders such that a later access will not trigger an unlock dialog. --unlock is only available in desktop mode.
This command can be used to unlock folders if no one is physically present to enter the necessary passphrase; this allows files dropped into a now unlocked folder to be transparently encrypted/decrypted.
The usage format is:
pgpnetshare --unlock <input> --public-keyring <pubring> --private-keyring <priring> [input2 ...] --passphrase <phrase> [ --local-mode ]
Where:
--unlock is the command specifying that you want to unlock the specified locked folder.
<input> is the file or folder to be unlocked.
--passphrase is the option specifying the passphrase of the private key that signed the locked folder.
<phrase> is the actual passphrase of the private key used to sign the folder.
--public-keyring is the option specifying that a public keyring file should be used for an operation
<pubring> is the filename of the public keyring file.
--private-keyring is the option specifying that private keyring file should be used for an operation.
<priring> is the filename of the private keyring file.
Optional flags are:
--local-mode, which forces the use of local mode; passphrase and keyring caches are not enabled or used.
Example:
pgpnetshare --unlock C:\Projects\HR\ProjectX --passphrase '1Killer*Whale'
In this example, the locked folder "ProjectX" is being unlocked. The files in this folder are signed by the private key whose passphrase is provided.
Give that a whirl, if not then you might need to use PGP Command Line instead of NetShare, PGP CL has a lot more command line options than netshare, because I am assuming you need to automate the encrypt/decrypt which CL does very well.