Thread: system() without a DOS box popping out

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    108

    system() without a DOS box popping out

    Hello,

    I kept using system("delete blah"); etc to delete files or directory, but whenever that happens, a DOS box runs out. Well, now I found that you can use DeleteFile(), but what about if you wanna do other stuff like open a PDF file by calling an external, or do a "run.." thing ?

    Cheers

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    http://faq.cprogramming.com/cgi-bin/...&id=1043284392
    Try CreateProcess and ShellExecute
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    ShellExecute would be the easiest, as you can pass in the path to the PDF file, and it will open whatever application is setup to handle that set of files (Adobe Acrobat usually)

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    108
    awesome thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  3. fgets() to list box
    By tao in forum Windows Programming
    Replies: 4
    Last Post: 06-08-2006, 08:23 AM
  4. Multiline Edit Box Parser
    By The Brain in forum Windows Programming
    Replies: 6
    Last Post: 11-01-2005, 07:15 PM
  5. eliminating dos box
    By happy dude 82 in forum Windows Programming
    Replies: 1
    Last Post: 04-16-2003, 04:15 AM