Thank you Hunter2, your input was very helpful and I could get my program to work. However, I still have a few problems. Here is the updated code.
Code:
#include <iostream.h>
#include <windows.h>
#include <conio.c>
// GLOBAL VARS
bool music = false;
bool opera = false;
bool trillian = false;
bool imesh = false;
bool kazaa = false;
bool winmx = false;
int main()
{
MessageBox(NULL, "Hit OK, type the passkeys\nand hit ENTER.", "RoverRun", MB_OK);
char a[7];
cin >> a;
for(int i = 0; i < 8; i++)
{
if(a[i] == 'm') music = true;
if(a[i] == 'o') opera = true;
if(a[i] == 't') trillian = true;
if(a[i] == 'i') imesh = true;
if(a[i] == 'k') kazaa = true;
if(a[i] == 'w') winmx = true;
}
if(music)
{
system("cd..");
system("cd..");
system("cd Documents and Settings\\All Users.WINDOWS\\Documents\\Quent");
system("Music.m3u");
}
if(opera)
{
system("cd..");
system("cd..");
system("cd Program Files\\Opera7");
system("Opera.exe");
}
if(trillian)
{
system("cd..");
system("cd..");
system("cd Program Files\\Trillian");
system("trillian.exe");
}
if(imesh)
{
system("cd..");
system("cd..");
system("cd Program Files\\iMesh\\Client");
system("iMeshClient.exe");
}
if(kazaa)
{
system("cd..");
system("cd..");
system("cd Program Files\\Kazaa");
system("klrun.exe");
}
if(winmx)
{
system("cd..");
system("cd..");
system("cd Program Files\\WinMX");
system("WinMX.exe");
}
/* char mbox[];
int j = 0;
if(music) { mbox[j] = "Music Playlist launched.\n"; j += 25; }
if(opera) { mbox[j] = "Opera Browser launched.\n"; j += 25; }
if(trillian) { mbox[j] = "Trillian Chat Client launched.\n"; j += 25; }
if(imesh) { mbox[j] = "iMesh P2P Client launched.\n"; j += 25; }
if(kazaa) { mbox[j] = "KaZaA P2P Client launched.\n"; j += 25; }
if(winmx) { mbox[j] = "WinMX P2P Client launched.\n"; j += 25; }
*/
MessageBox(NULL, "Program terminated.", "RoverRun", MB_OK);
return 0;
}
My Music runs without a problem. However, iMesh, Kazaa, Trillian and WinMX all give me "The system cannot find the path specified. 'iMeshClient.exe' is not recognised as an internal or external command, operable program or batch file."
However, if I follow the program manually ( Run cmd, "cd..", etc. ) I can run iMesh, and the other programs, with no problems.
Finally, I cannot test if this program works with my multiple commands ( therefore if char a = "tm" for Trillian and Music ) due to the fact that only the "m" command works.
Any tips would be great Thanks.