Jason Paradis
asked on
VB app works fine in Debug but not in Release (program just executes batch files)
I've done some research and I know this is a common issue. There are several reasons why this could be happening. But let me lay out what the app does and maybe narrow the problem down.
I'm very newbish at programming. So much so that all the VB app does is run a batch file upon a button click.
The batch files contain a command that determines if the processor is 64bit or 32bit:
When I run my application in Debug mode the batch files run perfectly fine. Everything executes and completes. However, when I go to release the app and run the EXE file it seems like the batch files are ignoring the processor architecture line. The file doesn't go to the 64BIT section and just processes everything in line. Or it's not processing the 64 bit line correctly and it's going to the 32bit section.
Here is a snippet of code from one of the buttons:
I know that the batch files can be executed with a single line, but I'm using this for now to learn.
Would anyone know why the batch files are running fine under Debug but not when the EXE is run by itself?
I'm very newbish at programming. So much so that all the VB app does is run a batch file upon a button click.
The batch files contain a command that determines if the processor is 64bit or 32bit:
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" goto 64BIT
When I run my application in Debug mode the batch files run perfectly fine. Everything executes and completes. However, when I go to release the app and run the EXE file it seems like the batch files are ignoring the processor architecture line. The file doesn't go to the 64BIT section and just processes everything in line. Or it's not processing the 64 bit line correctly and it's going to the 32bit section.
Here is a snippet of code from one of the buttons:
Private Sub RunningButton_Click(ByVal sender As System.Object, e As EventArgs) Handles RunningButton.Click
Dim proc As Process = Nothing
Try
Dim batDir As String = String.Format("\\remoteserver\software\batch_files\inhouseapp fixes\")
proc = New Process()
proc.StartInfo.WorkingDirectory = batDir
proc.StartInfo.FileName = "inhouseapp Already Running.bat"
proc.StartInfo.CreateNoWindow = False
proc.Start()
proc.WaitForExit()
'MessageBox.Show("Bat file executed !!")
Catch ex As Exception
Console.WriteLine(ex.StackTrace.ToString())
End Try
End Sub
I know that the batch files can be executed with a single line, but I'm using this for now to learn.
Would anyone know why the batch files are running fine under Debug but not when the EXE is run by itself?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm closing this question due to the fact that I'm now trying to write what the batch files do in VB. I've been slightly successful but am hitting roadblocks elsewhere. I will not be using the batch files anymore.
I do have more questions but I'll create a new topic since it has to do with my new VB code than the batch files.
Thanks.
I do have more questions but I'll create a new topic since it has to do with my new VB code than the batch files.
Thanks.
ASKER