running a batch file from asp.net web page
-
Hi, I am having trouble running a .bat file from my web application. The file is run by the server but it doesn't perform its function correctly. I can run the .bat file on the server my self and it works fine, so it not written wrong, but when run by my aspx page it just doesn't do what it is supposed to. I have tried a couple of different methods and neither seem to work. The app is impersonating an admin account on the server with full domain admin permissions, and the .bat file is running accross multple servers. does anyone have any Idea what may be the problem? many thanks mark
-
Hi, I am having trouble running a .bat file from my web application. The file is run by the server but it doesn't perform its function correctly. I can run the .bat file on the server my self and it works fine, so it not written wrong, but when run by my aspx page it just doesn't do what it is supposed to. I have tried a couple of different methods and neither seem to work. The app is impersonating an admin account on the server with full domain admin permissions, and the .bat file is running accross multple servers. does anyone have any Idea what may be the problem? many thanks mark
can you try this..? Process pr = new Process(); pr.StartInfo.RedirectStandardOutput = true; pr.StartInfo.UseShellExecute = false; pr.StartInfo.FileName = Server.MapPath("urapp.bat"); pr.StartInfo.Arguments = "your arguments" pr.Start(); pr.WaitForExit(); pr.Close();