system() without a DOS box popping out

This is a discussion on system() without a DOS box popping out within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I kept using system("delete blah"); etc to delete files or directory, but whenever that happens, a DOS box runs ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    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, 09:25 AM
  2. Replies: 9
    Last Post: 02-13-2008, 01: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, 06:15 PM
  5. eliminating dos box
    By happy dude 82 in forum Windows Programming
    Replies: 1
    Last Post: 04-16-2003, 04:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21