CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    4

    How to pass Arguments to command prompt of Visual studio 2005 from a window applic..

    i need to execute from a window application the command csc HelloWorld.cs

    i tried like this........
    System.Diagnostics.Process p= new System.Diagnostics.Process();

    p.StartInfo.FileName = "Visual Studio 2005 Command Prompt";

    /// here i got the command prompt for visual studio 2005"....

    now i need to pass the arguments... HOW it should be ,,,,,,
    i tried like this... but ERROR

    p.StartInfo.Arguments = "csc HelloWorld.cs";

    at this point i got thr Error as shown below:

    Error in script usage. The correct usage is:
    "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" [option]
    where [option] is: x86 | ia64 | amd64 | x86_amd64 | x86_ia64

    For example:
    "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86_ia64

    C:\Program Files\Microsoft Visual Studio 8\VC>

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: How to pass Arguments to command prompt of Visual studio 2005 from a window applic..

    Code:
    Process.Start("cmd", "/C COPY "C:\Test.txt" "C:\Test\Test.txt");
    the "/C" argument tells the command prompt what commands to run after it opens.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured