Need help .....
-
I have following requirement to develop in C# Open command prompt i.e. invoke cmd.exe run cd/ command run command1 run coomand2 run command 3 run exit command I need to save the output of the command1 , command2 and command3 in the same text file. Please provide a sample code to execute multiple commands one by one and save output to same text file
-
I have following requirement to develop in C# Open command prompt i.e. invoke cmd.exe run cd/ command run command1 run coomand2 run command 3 run exit command I need to save the output of the command1 , command2 and command3 in the same text file. Please provide a sample code to execute multiple commands one by one and save output to same text file
Errm, ..., no. But have a look at MSDN on the Process class[^]. It is used to start other processes. Pay special attention to its StandardOutput[^] and StandardError[^] properties. They give you access to the called processes' outputs. Finally, use File.WriteAllText()[^] to store the results in a file. Or forget it all and go for Eddy Vluggen's proposal.
Ciao, luker
-
I have following requirement to develop in C# Open command prompt i.e. invoke cmd.exe run cd/ command run command1 run coomand2 run command 3 run exit command I need to save the output of the command1 , command2 and command3 in the same text file. Please provide a sample code to execute multiple commands one by one and save output to same text file
superselector wrote:
I have following requirement to develop in C#
Basically a batch-file whose output is redirected. A batch-file is a collection of commands that are executed one after another;
DIR C:\TEST
DIR C:\TEST2You could redirect the output when calling the batch-file, like "MYBATCH.BAT >C:\RESULT.TXT".
superselector wrote:
Open command prompt i.e. invoke cmd.exe
Google for "C# redirect console output" for examples.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
I have following requirement to develop in C# Open command prompt i.e. invoke cmd.exe run cd/ command run command1 run coomand2 run command 3 run exit command I need to save the output of the command1 , command2 and command3 in the same text file. Please provide a sample code to execute multiple commands one by one and save output to same text file
superselector wrote:
Please provide a sample code to execute multiple commands one by one and save output to same text file
No. That isn't how it works here. We don't do homework, and we don't do your work for you either. If you want code written for you to a specific specification, you have to pay - I suggest you go to VWorker.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. If on the other hand you try to do it and get stuck, then feel free to ask for help with a specific problem and we will be glad to assist. But we aren't going to do it all for you.
The only instant messaging I do involves my middle finger. English doesn't borrow from other languages. English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
-
I have following requirement to develop in C# Open command prompt i.e. invoke cmd.exe run cd/ command run command1 run coomand2 run command 3 run exit command I need to save the output of the command1 , command2 and command3 in the same text file. Please provide a sample code to execute multiple commands one by one and save output to same text file
superselector wrote:
Need help.....
You certainly do!
Never underestimate the power of human stupidity RAH
-
superselector wrote:
Please provide a sample code to execute multiple commands one by one and save output to same text file
No. That isn't how it works here. We don't do homework, and we don't do your work for you either. If you want code written for you to a specific specification, you have to pay - I suggest you go to VWorker.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys. If on the other hand you try to do it and get stuck, then feel free to ask for help with a specific problem and we will be glad to assist. But we aren't going to do it all for you.
The only instant messaging I do involves my middle finger. English doesn't borrow from other languages. English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
Hi i have implemented the same in vbscript . i was aware of the batch file concept but wanted to configure the commands in the code itself using Process class in C#.as i don't want it in batch .. thanks for your suggestion though.