I have a scenario where I want to open the command prompt while execute the following method -
public static int executeScript(){
String scriptPath = "C:\\test"
String command = "cmd /c start "+scriptPath+"\\backup.bat > "+scriptPath+"\\Logs.txt";
Process process = Runtime.getRuntime().exec(command);
return process.waitFor();
}
User wants to see the command prompt when the testRun.bat executes. When we deploy the application from command prompt it is running as expected user see the command prompt of the backup script execution. But In the production environment the application runs as window service, In this case the command prompt is not visible.
How can I show the command prompt when application is running as window's service?
thanks in advance.