Thread: open a file on the computer

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    385

    open a file on the computer

    How is it possible in C++ .NET to open a file on the computer.

    Lets say that I am trying to open this file. Is this possible to do. In this case, Wordpad will open.
    Thanks


    Code:
    "C:\\WordPadFile.rtf"

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    I have tried out to open this like this but when the file is opened. The cmd.exe is also opened. Is this possible to prevent ?

    Code:
    system("C:\\exitfile.txt");

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    385
    I found a solution like this. This do seem to work:

    Code:
     System::Diagnostics::Process::Start("C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32");

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  3. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  4. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM