So heres my problem, I'm trying to get my jar file to open up 5 files with time in between each file opening. When runPrograms[] is set to notepad.exe instead of the direct file path it will open up notepad just fine. However whenever I try to get it to open up the files that are currently in the code it doesn't accomplish anything. I tried placing the Jar in the folder Startup with the other folders and shortening the path and that didn't work.
When I manually open the files they all work, so theres no compatibility problems with the files. I believe my problem lies within the file paths. I've tried forward and backslashes but it still doesn't open any files.
import java.lang.*
import java.io.*
public class LoadFiles
{
public static void main(String args[])throws IOException
{
Runtime r = Runtime.getRuntime();
String[] runPrograms = new String[5];
runPrograms[0] = "C:/Users/Dark/Desktop/Startup/MaNGOS-Fun-Server-Repack-1.20/Server/Apache.bat";
runPrograms[1] = "C:/Users/Dark/Desktop/Startup/MaNGOS-Fun-Server-Repack-1.20/Server/MySQL.bat";
runPrograms[2] = "C:/Users/Dark/Desktop/Startup/MaNGOS-Fun-Server-Repack-1.20/MaNGOS-Server/realmd.exe";
runPrograms[3] = "C:/Users/Dark/Desktop/Startup/MaNGOS-Fun-Server-Repack-1.20/MaNGOS-Server/mangosd.exe";
runPrograms[4] = "C:/Users/Dark/Desktop/Startup/Ventrilo Server/ventrilo_srv.exe";
int[] timePrograms = new int[5];
timePrograms[0] = 5000;
timePrograms[1] = 5000;
timePrograms[2] = 5000;
timePrograms[3] = 5000;
timePrograms[4] = 5000;
for(int i=0;i<5;i++)
{
try
{
r.exec(runPrograms[i]);
Thread.sleep(timePrograms[i]);
}
catch
{
System.out.println("Error==="+e.getMessage());
e.printStackTrace();
}
}
}
}