0

Hey

I would like to do a ".bat' type of command in C#: Something automated. Im trying to run a program that is sort of shell itself so it just need to input certain words/letters into the command line box. Lets see if I can explain it better with a theoretical example:


[start of cmd]
C:\>echo hello
hello

C:\>someshell
[start of someshell: It has a command deleteall that deletes everything. It has a command bye that exits someshell]
> deleteall
Are you sure you want to delete all? [Y/N] Y
Everything has been deleted!
> bye
[end of someshell]
C:\>exit
[end of cmd]


As you can see the things I would have to type in the prompt if in cmd are:

echo hello
someshell
deleteall
Y
bye
exit

The biggest problem is the "Y" I believe, since cmd invokes someshell which at the same time and during invokes deleteall.

How could I do this in C#? Thanks.

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by thines01
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.