Rainbow Portal Community

Rainbow Portal forums, blogs, news and more
Welcome to Rainbow Portal Community Sign in | Join | Help
in Search

How to run a batch file on server side using asp.net? Please help

Last post 02-02-2006, 6.12 by Dejan. 0 replies.
Sort Posts: Previous Next
  •  02-02-2006, 6.12 11717

    How to run a batch file on server side using asp.net? Please help

    hi everyone,
    I am trying to run a batch file using asp.net

    I have tried using this code:

    private void ExecuteRequest()
    {

    string Fichier=Server.MapPath("")+"\\SearchEng\\request.bat";
    Process proc=new System.Diagnostics.Process();
    proc.StartInfo.WindowStyle=ProcessWindowStyle.Maximized;
    proc.StartInfo.WorkingDirectory=Server.MapPath("")+"\\SearchEng\\";

    proc.StartInfo.FileName=Fichier;

    try
    {
    proc.Start();
    proc.WaitForExit();
    proc.Close();

    }

    catch(Exception ex)
    {
    this.lblerror.Text="error 2 "+ex.Message;
    }

    }
View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems