Click here to Skip to main content
15,884,986 members
Home / Discussions / C#
   

C#

 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
Richard MacCutchan14-Feb-13 10:08
mveRichard MacCutchan14-Feb-13 10:08 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson14-Feb-13 10:27
adam.m.b.nelson14-Feb-13 10:27 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
Richard MacCutchan14-Feb-13 22:57
mveRichard MacCutchan14-Feb-13 22:57 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson15-Feb-13 2:21
adam.m.b.nelson15-Feb-13 2:21 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson3-Feb-15 6:11
adam.m.b.nelson3-Feb-15 6:11 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
Richard MacCutchan14-Feb-13 6:35
mveRichard MacCutchan14-Feb-13 6:35 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson14-Feb-13 6:54
adam.m.b.nelson14-Feb-13 6:54 
AnswerRe: Send/Receive text to CMD from C# GUI Pin
Alan N14-Feb-13 7:32
Alan N14-Feb-13 7:32 
First of all test StudioCommandPrompt to find out if it is using the standard input, output and error streams correctly.

Here is an example of how it's done using the command processor, cmd.exe, which everyone should have.

At a command prompt enter
cmd < inputcommands.txt > stdout.txt 2>stderr.txt

This will start a new cmd.exe which will take redirected input from the file inputcommands.txt. Standard output will be redirected to the file stdout.txt and standard error to stderr.txt.

A suitable inputcommands.txt is
time /t
date /t
non-existent.exe
exit


Simple stuff: output the date, the time, try to exec an app that isn't there (to cause an error) and then exit.
Here is the contents of the output files
stdout.txt
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

XXXXXXX>time /t
17:47

XXXXXXX>date /t
14/02/2013 

XXXXXXX>non-existent.exe

XXXXXXX>exit

stderr.txt
'non-existent.exe' is not recognized as an internal or external command,
operable program or batch file.


You would have to come up with a suitable set of inputs for StudioCommandPrompt and then run a similar test.
i.e. At a command prompt enter
StudioCommandPrompt < inputcommands.txt > stdout.txt 2>stderr.txt

It probably would be wise to run this test in steps

1) Check if your app will read from redirected input
StudioCommandPrompt < inputcommands.txt

2) If that's ok, test if output can be redirected
StudioCommandCommandPrompt < inputcommands.txt > stdout.txt

3) and separately test if error can be redirected, or possibly if the error stream is used at all.
StudioCommandPrompt < inputcommands.txt 2>stderr.txt

If it all checks out OK come back to me and we'll take it from there.

Alan.
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson14-Feb-13 7:48
adam.m.b.nelson14-Feb-13 7:48 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson14-Feb-13 8:23
adam.m.b.nelson14-Feb-13 8:23 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
Alan N14-Feb-13 9:57
Alan N14-Feb-13 9:57 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
jschell14-Feb-13 11:44
jschell14-Feb-13 11:44 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
adam.m.b.nelson15-Feb-13 2:22
adam.m.b.nelson15-Feb-13 2:22 
GeneralRe: Send/Receive text to CMD from C# GUI Pin
jschell15-Feb-13 8:57
jschell15-Feb-13 8:57 
Questionobject recognition Pin
manoj dhunelg14-Feb-13 2:42
manoj dhunelg14-Feb-13 2:42 
AnswerRe: object recognition Pin
Richard MacCutchan14-Feb-13 3:41
mveRichard MacCutchan14-Feb-13 3:41 
AnswerRe: object recognition Pin
Dave Kreskowiak14-Feb-13 6:14
mveDave Kreskowiak14-Feb-13 6:14 
Questionforcing users to use English language Pin
sina rafati nia13-Feb-13 21:23
sina rafati nia13-Feb-13 21:23 
AnswerRe: forcing users to use English language Pin
Manfred Rudolf Bihy13-Feb-13 22:29
professionalManfred Rudolf Bihy13-Feb-13 22:29 
AnswerRe: forcing users to use English language Pin
N a v a n e e t h13-Feb-13 22:30
N a v a n e e t h13-Feb-13 22:30 
GeneralRe: forcing users to use English language Pin
harold aptroot13-Feb-13 23:33
harold aptroot13-Feb-13 23:33 
AnswerRe: forcing users to use English language Pin
ali_heidari_14-Feb-13 5:55
ali_heidari_14-Feb-13 5:55 
AnswerRe: forcing users to use English language Pin
jschell14-Feb-13 11:46
jschell14-Feb-13 11:46 
Questionwebbrowser control in c# Pin
eldhose198513-Feb-13 18:28
eldhose198513-Feb-13 18:28 
AnswerRe: webbrowser control in c# Pin
N a v a n e e t h13-Feb-13 19:07
N a v a n e e t h13-Feb-13 19:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.