troubleshooting Question

Csharp running batch file Issue

Avatar of ankouny
ankounyFlag for United States of America asked on
C#ASP.NET.NET Programming
7 Comments1 Solution396 ViewsLast Modified:
Hi,
I'm trying to run a batch file on the server using an asp.net csharp webpage. After I execute below code  the batch is not showing that it is running and the webpage is not throwing an error.
Here is the code in the webpage button :
string str_Path = Server.MapPath(".") + "\\TLogExecutor.bat";
            ProcessStartInfo processInfo = new ProcessStartInfo(str_Path);
            processInfo.UseShellExecute = false;
            Process batchProcess = new Process();
            batchProcess.StartInfo = processInfo;
            batchProcess.Start();

------------------------------------------------
Here is the batch file code :
PSEXEC -accepteula \\tlog-server "e:\Sched_Processes\TLogExecutor_Launch_Rerun.bat" > D:\Inetpub\wwwroot_2\TLogStatus\Log.txt

Please notice that Batch file is trying to run another batch on another server ?
Any suggestions ?

Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros