I've been trying to figure this out for a while. I've searched online and the solutions I've tried don't seem to work.
This runs ok from my PC:
Dim sourceName As String = File_To_Encrypt
Dim gpgsourceName As String = File_To_Encrypt & ".gpg"
Dim argumentString As String = " --batch --yes --recipient recname --encrypt " & sourceName
Dim gpgcmd As String = "\\serv2014\c$\Program Files (x86)\GnuPG\bin\gpg.exe"
Process.Start(gpgcmd, argumentString)
When I try to run in production it does not work. I'm a newbie to VB I've tried any number of combos :
"""\\serv2014\c$\Program Files (x86)\GnuPG\bin\gpg.exe"""""
ControlChars.Quote & "\\serv2014\c$\Program Files (x86)\GnuPG\bin\gpg.exe" & ControlChars.Quote
Even this I saw from searching: "c:\sp` ace\test.ps1" << did not work
"\\serv2014\c$\Program` Files` (x86)\GnuPG\bin\gpg.exe"
I read this: Note: In VB.NET, the escape character of " is "". With three quotes it just seemed to hang the process:
"""\\serv2014\c$\Program Files (x86)\GnuPG\bin\gpg.exe"""
Tried this too: error message is system cannot find file specified
"\\serv2014\c$\Program Files (x86)\GnuPG\bin\gpg.exe"""
Appreciate any suggestions.
I can run it fine on my PC, the Windows admin told me if the path had a space in it then I had to quote it properly.
I can execute the command from the cmd line of my PC - no problem.
I can run the vb program from the button of my Visual Studio - runs ok. I can run the command like this from the cmd line on my PC:
C:\WINDOWS\system32>"\\serv2014\c$\Program Files (x86)\GnuPG\bin\gpg.exe" --batch --yes --recipient recpname --encrypt \\serv2014\e$\Extracts\filename.csv
When I build the .exe put it on the server and run it from the scheduler - it doesn't work. I asked the Windows admin if it was a permissions thing - he said no. I'm new to this Windows VB stuff, so not sure what else to check.
I mentioned what the results where it either hangs - job gets to this step and hangs does not exit I have to kill the process. Or as mentioned there is a message in the error log "system cannot find file specified"