I was wondering if I could open a third party application or file inside of a C++ program. I want to be able to type a phrase and open a program. Can someone help me? Thanks in advance!
"Directory/File.exe" needs to contain the full drive+path+filename. Any '\' character needs to be doubled to '\\'.
If there are spaces in the path, you will need to enclose the entire command in quotes, remember to escape them with the '\' character too.
No errors appear. The program is(in its' current state), meant to take in a variable. If that variable is "type", it's supposed to take in random words. If that first variable is "open c++, then it's supposed to open Microsoft Visual C++ 2010 Express. What part of my code prevents this from occurring?
system("C:\\Users\\Michael\\Desktop\\Microsoft\Visual\C++\2010\Express");
shouldn't that be more like: system("C:\\Users\\Michael\\Desktop\\Microsoft\\Visual\\C++\\2010\\Express");
and should there be a .exe on the end? I don't know the name of the executable.
Ignoring the use of system() when there are better alternatives, I'm fairly sure the path is incorrect. My path and filename are "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe"
The files on your desktop are almost definitely NOT exe files, but rather lnk files, which is the (very much hidden) extension windows uses for shortcut files. You can tell visually if it's an lnk file by the little swooshing arrow at the bottom left inside the icon indicating that it is. The shortcut on your desktop, if you right click it and view its properties, actually points to a real exe file somewhere else. (Labeled as 'Target' in the properties page / Shortcut tab.) This is what you're more interested in.