I am facing a problem with a .bat file run from Java web application.
Current setup in local machine: create web application and method contains
Process p = Runtime.getRuntime().exec("c:/test/myFile.bat");
When I run above code, its showing file not found
.
But if I copied the .bat file to tomcat bin folder it's working fine. But I need to execute the bat file in my separate folder, I even set the class path also, but I'm not able to execute the bat.
Screen 1:
I have placed 5 files in Tomcat root directory din folder, as well as placed at c:/psgsscripts/--> folder also (check the Java code; only bat file is taken other .tbc files are looking at Tomcat bin folder location at run time)
Screen 2:
bat file contains tclsh psg.tbc %1
Screen 3:
web application java code in class method( newjobid is the parameter for .bat file)
Screen 4:
If I placed it all .bat file and .tbc files bin folder it's working fine (Java code represent read the .bat file from c drive but other .tbc files look at Tomcat bin folder at run time)
but requirement is those files are placed at other drives (other than Tomcat folder) like C or D or E drivers.