Context:
I have a VB.Net application that executes a python script. Once the script executes, the VB application captures the output and continues. The python script only executes successfully when the VB application creates a Process with CreateNoWindow = False. Note that the python script does execute a subprocess. It seems that the python subprocess cannot execute within the context of the VB application, unless a cmd window is created.
Below is how I configure the process in VB:
ProcessObj.FileName = "cmd.exe"
ProcessObj.WorkingDirectory = Directory
ProcessObj.Arguments = "C:" '"dir"
ProcessObj.RedirectStandardInput = True
ProcessObj.RedirectStandardOutput = True
ProcessObj.RedirectStandardError = True
ProcessObj.UseShellExecute = False
ProcessObj.CreateNoWindow = False
EDIT:
After doing some more simplified testing, I have reduced the issue to a simple VB.net application that creates a process that runs an executable via CMD prompt. The output of CMD prompt can only be captured with a window. If the window is not enabled, then the output to CMD prompt is lost.
Questions:
What can I do to work around the CreateNoWindow=False requirement?
Is there an alternative for executing the python script?
Why does the python script subprocess not execute?