i have a lot of games. so it is very difficult to search the exe files . so is it possible to write a program to execute a file
rgds
saimadhav
i have a lot of games. so it is very difficult to search the exe files . so is it possible to write a program to execute a file
rgds
saimadhav
Yes, it most likely can be done. However, what do you ACTUALLY want to do? Search for a .exe file by name and then execute it, or something else?
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
no..
imagine i already know where the exe`s are located . i would like to make a program that will execute these exe`s on my inputs
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
i want the code in c++ that would execute a file
for ex;
what should the code be afterCode:main() { char game; cout<<"Enter game"; cin>>game; if (game==GTA) { }Code:if (game==gta)
Seems like what you want is a table of which game is where. You can do it like you describ, but game should probably be a std::string, and you would want quotes around "GTA".
Then you call "ShellExecute()" [or system()] with the path to the game.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
could you give an example?
This is a perfect job for a scripting language.
Isn't that what the start menu is for?
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Yes, but I'm thinking of the actual hierarchical menu, not starting a Run dialog or a command prompt.
In my Windows installation, I've completely reorganized my Programs submenu. Now there's "Games", "Programming", "Background", "Drivers & Co" and "Other".
Of course, systems where there's no company ego dictating things, such a sane categorization is done by default (hint: Linux desktops). It's only on Windows that anyone thinks that finding a program in CompanyName -> ProductName -> ProductName is normal.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
ya i know why there is a start menu! i am asking how do u execute a file by programming in c++?
You use, as I explained earlier, ShellExecute() or system(). The former is a Windows API call, which isn't exactly simple, the second just takes a string of something the computer will hopefully be able to execute - if it's wrong, there will be a return code to explain what went wrong.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
If your executing ONLY programs, then use CreateProcess(), and you don't need an example, instructions on using the function are here.