Quantcast
Channel: aras PLM community
Viewing all articles
Browse latest Browse all 1103

Trying to execute custom batch file through Aras

$
0
0

Hello All

I have created an action with a method(server side in c#) to run a batch file located in local system. Here is the code below - 

Innovator inn = this.getInnovator();

string path = CCO.Server.MapPath("temp/test.bat");

try

{

    ProcessStartInfo processInfo = new ProcessStartInfo("CMD.Exe");

    processInfo.Arguments = "/c" + path;

    processInfo.UseShellExecute = false;

    Process.Start(processInfo);

}

catch(Exception e)

{

    return inn.newError(e.Message);

}

return this.getInnovator().newResult("SUCCESS");

 

The above code is compiled and executed successfully and message comes as 'Success' but it is not opening the command prompt and not executing the batch file.

If I take the same code and run it in the console application then it works successfully.

 

Am I missing something in the code so that it runs the batch file from Aras ? Please help !!!!


Viewing all articles
Browse latest Browse all 1103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>