Click here to Skip to main content
14,027,342 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am trying to do gpg encryption through batch file
I get 'A 32 bit processes cannot access modules of a 64 bit process.' exception invoking Process.Start()

What I have tried:

Here is a sample of my code
Dim gpgPath As String = System.IO.Directory.GetDirectoryRoot(AppDomain.CurrentDomain.BaseDirectory) & "ABProreports\ME_ONBOARDING\Encryption\" & Format(Date.Now, "ddMMyyyy")
Dim mFileNo As Byte = 1

Dim myProcess As New System.Diagnostics.Process
myProcess.StartInfo.WorkingDirectory = System.IO.Directory.GetDirectoryRoot(AppDomain.CurrentDomain.BaseDirectory) & "APP_SERVER\ABPro\"
myProcess.StartInfo.FileName = (gpgPath & "\Encrypt_" & mFileNo & ".bat")
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardOutput = True
Updated 18-Mar-19 2:42am
Richard MacCutchan 18-Mar-19 5:11am
You need to build your application as a 64-bit process.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you want to run a batch file, you should do it like this:
myProcess.StartInfo.UseShellExecute = True
myProcess.StartInfo.RedirectStandardOutput = False
Note that you can't use RedirectStandardOutput this way !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web05 | 2.8.190419.4 | Last Updated 18 Mar 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100