I want to show console output in my cmd prompt in C# winform application

Hi,
I'm launching the some process in C# .net Winform appliaction. But i couldn't able to see console output on the screen. The process is getting launched but inside cmd prompt window, it is showing nothing. I would like to show something on cmd prompt. Please
help on this.
 using (Process comxdcProcess = new System.Diagnostics.Process())
                        comxdcProcess.StartInfo.FileName = fileName;
                        comxdcProcess.StartInfo.Arguments = args;
                        comxdcProcess.StartInfo.RedirectStandardError = true;
                        comxdcProcess.StartInfo.RedirectStandardOutput = true;
                        comxdcProcess.StartInfo.UseShellExecute = false;
                        comxdcProcess.Start();
                        this.errorComment = comxdcProcess.StandardError.ReadToEnd();
                        StreamReader myStreamReader = comxdcProcess.StandardOutput;
                        //// Read the standard output of the spawned process. 
                        this.errorComment = myStreamReader.ReadToEnd();
                        comxdcProcess.WaitForExit();
click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you Happy Programming! Hari

@Hariprasadbrk
Do you mean you have use process class to start "cmd prompt" And want to display some output in it?
If so, there is no need to use RedirectStandardOutput property. This property means the output of an application is written to the
Process.StandardOutput stream.
// Setup the process with the ProcessStartInfo class.
ProcessStartInfo start = new ProcessStartInfo();
start.FileName = @"C:\7za.exe"; // Specify exe name not cmd exe.
start.UseShellExecute = false;
start.RedirectStandardOutput = true;
// Start the process.
using (Process process = Process.Start(start))
// Read in all the text from the process with the StreamReader.
using (StreamReader reader = process.StandardOutput)
string result = reader.ReadToEnd();
Console.Write(result);
Output
This section shows the output of the process.
7-Zip (A) 4.60 beta Copyright (c) 1999-2008 Igor Pavlov 2008-08-19
Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
[<@listfiles...>]
So you can start a cmd exe.
Please also take a look at the article from codeproject
How to redirect Standard Input/Output of an application
In summary, the shutdown proces is invoked from my application, and it displays the output from the process in RichTextBox control.
Have a nice day!
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • I want to show database output in table format by using javafx 1.2

    this code is running in javafx 1.1,but this code is not running in javafx 1.2 . i don't know about the differrence between javafx 1.1 and javafx 1.2.so plz change the code in javafx 1.2 . Iam struggling to create in javafx 1.2
    * Main.fx
    * Created on Sep 27, 2007, 9:37:26 AM
    package tablesample;
    * @author Radhika Gehant
    import javafx.ui.*;
    import javafx.ui.*;
    import java.lang.Thread;
    import java.lang.Exception;
    import java.sql.*;
    class Customer {
    attribute Name: String;
    attribute Addressline1: String;
    attribute Addressline2: String;
    attribute City: String;
    attribute Phone: String;
    attribute Email: String;
    class customerOperations {
    attribute customer : Customer*;
    public
    operation getCustomer();
    attribute datasource : DatabaseAccess;
    customerOperations.datasource = null;
    operation customerOperations.getCustomer() {
    var rs = this.datasource.processDBQuery("SELECT * FROM CUSTOMER");
    while(rs.next()) {
    println("City: {rs.getString('City')} Name: {rs.getString('Name')}");
    insert Customer{City: rs.getString('City') Name: rs.getString('Name') Addressline1: rs.getString('Addressline1') Addressline2: rs.getString('Addressline2') Phone: rs.getString('Phone')} into this.customer;
    }// getCustomer
    var db : DatabaseAccess = null;
    var rs : ResultSet = null;
    /*//Using JavaDB
    db = DatabaseAccess{driverName: 'org.apache.derby.jdbc.ClientDriver'
    jdbcUrl   : 'jdbc:derby://localhost:1527/sample'
    user      : 'app'
    password  : 'app'};
    //Using MySQL
    db = DatabaseAccess{driverName: 'com.mysql.jdbc.Driver'
    jdbcUrl   : 'jdbc:mysql://localhost:3306/MyNewDatabase'
    user      : 'root'
    password  : 'nbuser'};
    try {
    // Connect to database
    db.connect();
    var Allcustomers = customerOperations {
    datasource: bind lazy db
    Allcustomers.getCustomer();
    println("Name: {Allcustomers.customer.Name} ");
    //Begin Frame code
    Frame {
    height: 120
    width: 500
    title: "Populating Table From Database"
    onClose: function() {
    return db.shutdown();
    content: Table {
    columns:
    [TableColumn {
                    text: "Name"
    TableColumn {
    text: "Addressline1"
    TableColumn {
    text: "Addressline2"
    width: 100
    TableColumn {
    text: "City"
    alignment: TRAILING
    TableColumn {
    text: "Phone"
    alignment: CENTER
    cells: bind foreach(p in Allcustomers.customer)
    [TableCell {
                    text:bind p.Name
    TableCell {
    text:bind p.Addressline1
    TableCell {
    text: bind p.Addressline2
    TableCell {
    text: bind p.City
    TableCell {
    text: bind p.Phone
    visible: true
    }//end Frame code
    } catch(e:SQLException) {
    e.printStackTrace();
    * DataAccess.fx
    * Created on Sep 27, 2007, 9:46:04 AM
    package tablesample;
    * @author Radhika Gehant
    import javafx.ui.*;
    import java.lang.Thread;
    import java.lang.Exception;
    import java.sql.*;
    public class DatabaseAccess {
    private attribute driverName: String;
    private attribute jdbcUrl : String;
    private attribute user : String;
    private attribute password : String;
    public attribute driver : Driver;
    public attribute conn : Connection;
    private attribute rs : ResultSet;
    private attribute stmt : Statement;
    public
    operation connect();
    public
    operation shutdown();
    public
    operation tableExists(table: String);
    public
    operation processDBQuery(qry: String): ResultSet;
    }// Database
    attribute DatabaseAccess.conn = null;
    attribute DatabaseAccess.stmt = null;
    attribute DatabaseAccess.rs = null;
    operation DatabaseAccess.connect() {
    // Load driver class using context class loader
    var thread = Thread.currentThread();
    var classLoader = thread.getContextClassLoader();
    var driverClass = classLoader.loadClass(this.driverName);
    // Instantiate and register JDBC driver
    this.driver = (Driver) driverClass.instantiate();
    // JavaFX Class
    DriverManager.registerDriver(driver);
    // Connect to database
    this.conn = DriverManager.getConnection(this.jdbcUrl, this.user, this.password);
    }// Database.connect
    operation DatabaseAccess.processDBQuery(qry: String) :ResultSet {
    // process the query string
    try{
    if(null <> this.conn) { 
    if (this.stmt <> null) {
    this.stmt.close();
    this.stmt = null;
    if (this.rs <> null) {
    this.rs.close();
    this.rs = null;
    stmt = this.conn.createStatement();
    rs = stmt.executeQuery(qry);
    catch(e:SQLException) {
    e.printStackTrace();
    return rs;
    }//processDB

    Do you really need to post three messages with identical topic?
    You have an edit button, you know? That's the icon with a pencil, next to the envelope icon, on the top-right corner of your message (only for the last message of a thread).
    You also have a CODE button above your edit area, it will make code you post much more readable, as asterisks and plus signs are interpreted by the forum...
    i don't know about the differrence between javafx 1.1 and javafx 1.2See [JavaFX 1.2: Features and Enhancements|http://javafx.com/docs/articles/javafx1-2.jsp] for a good start.
    (Funny, I just noticed they write "Java FX" (with a space) in all the titles of the site. Bad for consistency...)

  • How to print console output

    Hi, I have a JSP page and I would like to print STDOUT to the page. Is this possible?
    I've seen a few methods and none work for me:
    BufferedReader reader = new BufferedReader(System.out);
    String input = reader.readLine();
    out.println(input);*** Error: Type BufferedReader was not found.
    FileOutputStream out;
                    PrintStream ps; // declare a print stream object
                    try {
                     // Create a new file output stream
                    out = new FileOutputStream("myfile.txt");
                            // Connect print stream to the output stream
                            ps = new PrintStream(out);
                            ps.println ("This data is written to a file:");
                System.err.println ("Write successfully");
                            ps.close();
                    catch (Exception e){
                            System.err.println ("Error in writing to file");
                    }*** Error: Duplicate declaration of local variable "out".
    *** Error: The type of the left-hand side in this assignment, "javax/servlet/jsp/JspWriter", is not compatible with the type of the right-hand side expression, "java/io/FileOutputStream".
    *** Error: No match was found for constructor "PrintStream(javax.servlet.jsp.JspWriter)".
    So what's next?
    How can I call the console without writing to a file first?
    I would like AJAX to show console output in real-time.

    Thanks for your help.
    The reason I have the script to write to a file is because it's the closest I could find to what I want. Ideally, I would be able to run a script that prints to the console but I want to grab the system.out going to the console and display it on the page.
    Basically, I want the page to act as a console but not redirect the output (I want it to still go to the console) and I don't want it in a text file that the page reads.
    So for example, the page loads and while that is occurring, the server grabs the console output and prints to the page. Then I run a function on the page that prints to the console and on the refresh, print the updated output. Ideally, I would restrict the output that was relevant to the page's functions and ignore every output to the console but I'm not (trying to be) picky.
    So how would that work?
    Pseudo-code:
    for (int i=0;i < System.out().length(); i++) {
            String grabbedtext += System.out().toString();
    }out.println(grabbedtext);

  • How do i get the approximate size of back up file required to save on disk using sql query because i want to show the required sapce for backup on my application

    hi i am face with problem that is i want to show the how much approximate space required for backup or .bak file to get backup using sql query because i want to show the required memory for backup file on my java application  

    Hi FIROZ
    TENNALI
    Is this still an issue, or can we close the thread?
    * closing a thread by marking the answer/s (there is a link beneath each response) and you can vote for useful responses as well (there is a link to vote on the left of each response)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How can i display console outputs in my form?

    Hi,
    <p>I have an application which performs some actions like, insert 200 rows in the database. While inserting data i am using <code>
    int i=0;
    system.out.println ("Insert "+i+" row in database");
    i=i+1;
    </code>
    The output displays on the commnad line.</p>
    <p>what i am trying to do is i have a form, which has text area. I want to display the console output "Insert 1 row in database" and next "Insert 2 row in database"..... and soon in the text area. How could i do that?</p>
    <p>Thanks in advance!!</p>

    Hi Petes,
    Thanks for you response. I am very new to java. I just started learning jsp and have bit knowledge of swing. I am confused how to use jsp and swing componenets together. Can you please guide me a bit?
    Also i am using AJAX to update form field. I am able to work with the rest except bringing the console output in the text area.
    Do you think i have some other way to do it?
    Do you think, it is a good idea , if I will save the output strings in a file and with the help of jsp i can read the file in textarea.
    Pin2g

  • How can i display console outputs in my form field?

    Hi,
    I have an application which performs some actions like, insert 200 rows in the database. While inserting data i am using
    int i=0;
    system.out.println ("Insert "+i+" row in database");
    i=i+1;
    The output displays on the commnad line
    what i am trying to do is i have a form, which has text area. I want to display the console output "Insert 1 row in database" and next "Insert 2 row in database"..... and soon in the text area. How could i do that?
    Thanks in advance!!
    pin2g

    solution removed, because you crossposted.
    Message was edited by:
    Navy_Coder

  • Want to convert RDF output in Excel & Pdf Format.

    Dear All,
    I want that when i run my report with showing the output report builder also convert that file or ask me an option in parameter that in which view you want to see the output of the report in Report Builder, In Excel, or In Pdf. when i choose Excel it open the excel and show the output in Excel, if select Pdf it open Acrobat Reader and open the output in Pdf.
    Kindly dear inform and tell me line by line procedure that how can we do that. i will be very greatful to you all,
    Thanks for your nice cooperation.
    Regards,
    Kamran J. Chaudhry

    Dear Rainer,
    First of all Dear thanks for your nice cooperation.
    secondly i apply the same line in my button press as i show you my code before and you said add only the code line which you send i do it but no result same in Report builder the report output is not showing in PDF i am using Report Builder 6i
    DECLARE
    PL_ID      PARAMLIST;
    BEGIN          
    PL_ID := CREATE_PARAMETER_LIST('REPDATA');
         ADD_PARAMETER(PL_ID,'P_DAILY_ID',TEXT_PARAMETER,:EMP_PROGRESS_MAT.DAILY_ID);
         ADD_PARAMETER(PL_ID,'PARAMFORM',TEXT_PARAMETER,'NO');
         ADD)PARAMETER(PL_ID,'DESFORMAT',TEXT_PARAMETER,'pdf');
         RUN_PRODUCT(REPORTS, 'D:\DAILY-PROGRESS\EMP_SINGLE_RPT',SYNCHRONOUS, RUNTIME, FILESYSTEM, PL_ID, NULL);
         Destroy_Parameter_List(pl_id);
    END;
    I also change in the System parameter DESFORMAT , Initial Value as a PDF
    Kamran J. Chaudhry

  • How to show data output in SSRS

    Below is my simply query.  I need to use Matrix SSRS format. I will put "Region" in "row" column, Header will use "Customer_Requested_Date" field, and will use "Amount" in the data session.
    The data output in the "Header" field will show January.....until December (current month is December).  In the Amount field under "December" (current month), I need to compute the formula like "Customer_Request_Month"
    < =  Current Month".  (I do not have the field name called Current Month, need to get a Date/Time function to display Current Month).
    How I can come up the data output under December Header field to show the current Amount in that section?
    November, 2014
    December,2014
    Region
    Amount
    CRD Month < = Current Month
    Select
    Customer_Request _Date,
    Customer_request_Month,
    Transaction_Type,
    Region,
    Amount
     From Table
    Thanks,
    Josephine
    Josey Tang

    Hi Josey,
    According to your descritption, you want to show the current month in your tablix. Right?
    In Reporting Services, we can use the Now() and datepart() function to get the current month. Please use the expression below:
    =Datepart("m",Now())
    In this scenario, since you want to show the amount of current month within the column group, you need to create another dataset which always show the data of current month. Then you can use lookup() function to get the amount value from the current dataset
    based on the Region. Please follow the steps below:
    Create a same dataset(DataSet2) using your query. Add a filter on this dataset. Make Fields!Customer_request_Month.Value
    =
    Datepart("m",Now())
    Then add a column inside of column group, using the expression below:
    =lookup(Fields!Region.Value,Fields!Region.Value,Fields!Amount.Value,"DataSet2")
    The design and result look like below:
    Reference:
    Expression Examples (Report Builder and SSRS)
    Lookup Function (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to run the report and show the output in excel file

    salam
    how to run the report and show the output in excel file,
    how to run the report and print the o/p via printer
    how to run the report and send the o/p via mail
    thank u all

    Hi,
    There are Parameters DESTTYPE, DESFORMAT and DESNAME. You can set these parameters to get as you want.
    1) Output in Excel File
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
         ADD_PARAMETER(PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'DELIMITED');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<file_name>.XLS');2) output to printer
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<printer_name>');3) Email - Have to configure SMTP and all. ( i didn't checked it)
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'MAIL');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<email_id>');Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • How to send console output to a html page

    hi,
    i wrote a java program, in that i used "System.out.println()" to print the output in the console. Now i want to print this output as a html page. output file is a simple physical HTML file. Please help me regarding this issue. Thanks in advance.

    Hi,
    you can use log4j.jar or comman-login.jar through you can do it. if you want more information related log4j then see this
    http://www.roseindia.net/tutorials/log4j/index.shtml
    Thanks,

  • Server console output

    Hi,
    I have been using flex from last six month. I have develped one application and now its time to deploy the application. But, I am facing one issue regarding server console output. In my application I have various remote call to java class deployed on JBOSS server. My problem is that, whenever I made any remote call the information of that remote call gets printed on server console. I want to stop this server console printing. How can I do this? Please suggest. I have checked in my code, there is no trace() or system.out.println() command is used. Please help me out of this. Its very urgent.
    Thanks.
    Regards,
    Ravindar Kumar

    Hi
    You can setup properties so that we can save stdout and stderr to files.
    In the setDomainEnv.cmd file of your domain, you can set the properties so that the ouput will be saved to a file
    %WLS_STDOUT_LOG%
    %WLS_STDERR_LOG%
    Vimala-

  • How to present a link to job (I want to bypass job output cycle wizard)

    Dear firends
    How to present a link to job (I want to bypass job output cycle wizard to open MyExample.BQY)
    http://MyServer:45000/workspace/browse/get/KursHYP2008/siyavus/MyExample?jobOutput=true&user=admin&pass=password
    this link shows wizard to open MyExample.BQY that I need to bypass it by putt it as parameter,
    regards

    Hello. Any update on this one ???
    Thanks in advance ...!

  • How to see console output in Sun Java(TM) System Web Server 6.1 SP7?

    Dear All,
    I am having Sun Java(TM) System Web Server 6.1 SP7 installed on Windows 2000 Prof.
    I have deployed few applications and they were running successfully.
    From debugging point of view, i like to see the output from System.out.println .
    Prior to SP7 there is a console which shows this output. But now the batch files only starts and stops the admin and site server services. Where to see for console output?
    Is there command like tail.exe of Weblogic awailable for Sun Java System Web Server or any setting to be done in Admin?
    Please revert.
    -Sameer

    Response headers can be found in srvhdrs pblock.
    Those can be manipulated by using set-variable
    http://docs.sun.com/app/docs/doc/820-1638/6nda01tea?l=en&a=view#abuis
    You can read more about these in
    Sun Java System Web Server 6.1 SP8 Administrator's Configuration File Reference
    http://docs.sun.com/app/docs/doc/820-1638?l=en
    and
    Sun Java System Web Server 6.1 SP8 NSAPI Programmer's Guide
    http://docs.sun.com/app/docs/doc/820-1643?l=en

  • Change console output device?

    Hi all,
    I have a laptop that I sometimes connect to a larger monitor.  I would like to be able to change my console output device so that I can connect to my larger monitor on the fly and have my console output switch over-- basically I'm looking for xrandr for the console (xrandr does the job just fine in X11).
    If I initially boot up with my laptop screen closed and my monitor connected, the console output goes to my monitor as desired.  But I would like to be able to switch output devices on the fly, rather than having to reboot to switch console output between my monitor and laptop screen.  Thanks for any help

    just found your post...
    I ask the same here http://bbs.archlinux.org/viewtopic.php?id=68589 without an answer yet, maybe you want to suscribe to mine as i do here in yours

  • Using dtrace to tap into local-zone console output?

    Was wondering if anyone has experimented with dtrace to capture zlogin console output for local zones. (all in the global ofcourse)
    (I don't want to run zlogin and capture its output to a file, since that would interfere with normal "zlogin" operation.)
    The idea would be to try and use dtrace to attach to some sort of centralized "zlogin construct/object" and then capure ALL zlogin console-output for ALL local zones, with dtrace, and then having that parsed out to log-files for each local zone.
    Might sound a little far-fetched, but until a standard interface for zone-console logging is created, this may be the base we can do?
    If you can think of alternatives, please share them.
    thanks,
    -- MikeE

    For the record: http://blogs.sun.com/roller/page/menno/20050525
    Menno

Maybe you are looking for

  • Displaying the title of the open panel when attached to a window...?

    This is probably a really obvious question... but when displaying the open panel as a panel/sheet attached to another window - is there a way to display the panel's title, or some other way to prompt the user? For example, I have a preferences window

  • Retrieving Payer for a business partner

    Hi Team, We are working on a requirment in product catalogue pricing. I am doing an implementiation on CRM_ISA_HDR_PRICING BAdI. Requirement is to pass some additional values here. I need to pass 'PAYER ' for a busines parter. Any one knows how to re

  • Release Strategy concept in sale order

    Dear All, My requirement is that credit limit check at the time of sale order creation will be three category i.e. if 10% excedds releasing authority will be user 1,If 15% exceeds releasing authority will be user 2 and If 20% exceeds releasing author

  • Control swf from separate swf in main file

    Im loading 2 swfs into my main swf. So I have a top swf and a bottom swf being loaded in externally into my main swf that makes 3 swfs, 1MAIN swf loading TOP swf & BOTTOM swf. Is there a way to have the bottom swf control or command the top swf? I ne

  • Empty frames?

    Hello, I try to order my photoalbum but keep getting this message: ' your album contains one or more pages with one or more frames without photo. Please change the lay-out of the pages or add photos to the frames before you can order the photobook'.