locked
executing windows shell from vb.net RRS feed

  • Question

  • Im using visual basic.NET  2005.
    Im trying to create an editor for compiling and excecuting java programs.
    I need to compile my programs in a button click
    using "javac <somefilename.java>" in the command prompt.
    also i need to display the compile errors in a text box in my .net application.

    how can i do it ??

    Also i need to know how to set an enviornment variable in system using vb.net2005.
    Kindly do send me the code so that i could resolve my problem.

    Tuesday, July 24, 2007 3:27 AM

All replies

  • ive this by using .net console. To use it within vb.net you can use shell command and for displaying errors just jump the javac output to a temp. file and open that file inside your application.

     

    Tuesday, September 11, 2007 5:28 AM
  • well

         use the shell command as follows

    first create a batch file

    --->

     open "filename.txt" for output as #1

     print #1,javac filename.java

    name   "filename.txt" as "filename.bat"

    close #1

     

     

    now execute this batch file

     

    shell("filename.bat")

     

     

     

    hope this works

     

     

    regards

    nana

    Tuesday, September 11, 2007 11:47 AM