I want to see the text in the command\dos window

  • Thread starter Thread starter PAPutzback
  • Start date Start date
P

PAPutzback

My Code
GPGProcess.StartInfo.FileName = "cmd"
GPGProcess.StartInfo.CreateNoWindow = False
GPGProcess.StartInfo.UseShellExecute = False
GPGProcess.StartInfo.RedirectStandardInput = True
GPGProcess.StartInfo.RedirectStandardOutput = True
GPGProcess.StartInfo.RedirectStandardError = True
GPGProcess.Start()
GPGProcess.StandardInput.WriteLine("dir")
GPGProcess.StandardInput.Flush()
GPGProcess.StandardInput.Close()

Now when I debug step by step all I see is the cursor in the cmd window
and no text. I want to debug each step. How come I don't see the
command prompt and then I don't see the text "dir" being sent to the
window.

Thanks,
Phil Putzback
 
PAPutzback said:
GPGProcess.StartInfo.FileName = "cmd"
GPGProcess.StartInfo.CreateNoWindow = False
GPGProcess.StartInfo.UseShellExecute = False
GPGProcess.StartInfo.RedirectStandardInput = True
GPGProcess.StartInfo.RedirectStandardOutput = True
GPGProcess.StartInfo.RedirectStandardError = True
GPGProcess.Start()
GPGProcess.StandardInput.WriteLine("dir")
GPGProcess.StandardInput.Flush()
GPGProcess.StandardInput.Close()

Now when I debug step by step all I see is the cursor in the cmd window
and no text. I want to debug each step. How come I don't see the
command prompt and then I don't see the text "dir" being sent to the
window.

RedirectConsole
<URL:http://dotnet.mvps.org/dotnet/samples/misc/RedirectConsole.zip>
 
I wish you could see what I see. I changed the code to this
'.FileName = "cmd"
..FileName = "c:\working\gpg\gpg.exe"
..Arguments = "--yes --output c:\working\inbound\test.txt
--decrypt c:\working\inbound\anstest.gpg"
And I don't see a thing in the window

But if I change this
..CreateNoWindow = False

There is plenty of text in the dos window that shows up.

My guess is because the app never shows the output because the process
has a prompt.

So I tried this to fill in the prompt with this
GPGProcess.StandardInput.Write("my password")
GPGProcess.StandardInput.Flush()
GPGProcess.StandardInput.Close()

but it doesn't appear to ever send the password to the process.
This has plagued me for a few days now.

Thanks,
Phil Putzback
 
Back
Top