So I've been fiddling with this for an hour or so now, checking out different methods of running a bat file from inside the java package.
I've got it inside resources/scripts, two things I've tried.
String filepath = curDir + "\\JavaArchive\\Mainfolder\\resources\\scripts\\Test.bat";
try {
Runtime.getRuntime().exec("cmd /c start " + filepath);
} catch (IOException ex) {
Logger.getLogger(DropDownTest.class.getName()).log(Level.SEVERE, null, ex);
}
and
try {
ClassLoader loader = DropDownTest.class.getClassLoader();
URL resource = loader.getResource("/scripts/Test.bat");
Process exec;
exec = Runtime.getRuntime().exec(resource.getPath());
InputStream inputStream = exec.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
String line = null;
while((line = br.readLine()) != null) {
System.out.println(line);
} } catch (IOException ex) {
Logger.getLogger(DropDownTest.class.getName()).log(Level.SEVERE, null, ex);
}
Nothing has worked out at all, not exactly sure where to go from here.
Any help with figuring this out would be appreciated.
Edit: Flagged as a duplicate question (Very helpful >.>)
After reading that post, while it didn't really help me at all, it still only renders the first method I tried as a dud, but not the second method.
Thanks