Open a file similar to using system("C:\\log.txt");

Hi, this might be something really easy to do but I don't know how
to...

Now I want to use c++ to execute this specific file on a specific
location.
Essencially this pice of code does the job, but the problem is that it
leaves command prompt open...

system("C:\\log.txt");

any suggestion?
thanks..
Jonathan

0
fachero1 (6)
8/29/2006 7:55:18 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
343 Views

Similar Articles

[PageSpeed] 52

You might check out ShellExecute().

-- 
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Medical-Fix" <fachero1@yahoo.com> wrote in message 
news:1156881318.395194.89260@i42g2000cwa.googlegroups.com...
> Hi, this might be something really easy to do but I don't know how
> to...
>
> Now I want to use c++ to execute this specific file on a specific
> location.
> Essencially this pice of code does the job, but the problem is that it
> leaves command prompt open...
>
> system("C:\\log.txt");
>
> any suggestion?
> thanks..
> Jonathan
> 


0
jwood (1291)
8/29/2006 7:59:15 PM
Hey Jonathan, well I gess we got the same great name! lol
Thanks so much for the fast responce!
That did the trick!

this is what I used:
ShellExecute(NULL,"open","Running_MTC_Application.doc",NULL,".\\",SW_RESTORE);


Regards,
Jonathan

0
fachero1 (6)
8/29/2006 8:31:08 PM
If you want your program to wait until the user quites from Word on your 
document try ShellExecuteEx().  Here is a good write up on the differences:

http://www.codeproject.com/system/newbiespawn.asp?df=100&forumid=3298&exp=0&select=1012328

Tom

"Medical-Fix" <fachero1@yahoo.com> wrote in message 
news:1156883468.641425.324990@m79g2000cwm.googlegroups.com...
> Hey Jonathan, well I gess we got the same great name! lol
> Thanks so much for the fast responce!
> That did the trick!
>
> this is what I used:
> ShellExecute(NULL,"open","Running_MTC_Application.doc",NULL,".\\",SW_RESTORE);
>
>
> Regards,
> Jonathan
> 


0
tserface (3860)
8/29/2006 9:04:07 PM
Reply:

Similar Artilces:

Open a file similar to using system("C:\\log.txt");
Hi, this might be something really easy to do but I don't know how to... Now I want to use c++ to execute this specific file on a specific location. Essencially this pice of code does the job, but the problem is that it leaves command prompt open... system("C:\\log.txt"); any suggestion? thanks.. Jonathan You might check out ShellExecute(). -- Jonathan Wood SoftCircuits Programming http://www.softcircuits.com "Medical-Fix" <fachero1@yahoo.com> wrote in message news:1156881318.395194.89260@i42g2000cwa.googlegroups.com... > Hi, this might be something re...