Deleting a program

This is a discussion on Deleting a program within the C++ Programming forums, part of the General Programming Boards category; Hey guys after I run a program I have created and I try to delete the file it is in ...

  1. #1
    182
    182 is offline
    Registered User
    Join Date
    Oct 2005
    Posts
    133

    Deleting a program

    Hey guys after I run a program I have created and I try to delete the file it is in I get the message:
    "access is denied make sure the disk is not full or wrute protected and that the file is not currently in use."

    I have looked in my processes and can't see anything, could it be a pointer problem or does anyone know why this would happen?

    Thanks.

  2. #2
    Registered User
    Join Date
    Feb 2006
    Posts
    4
    are you deleting it from a floppy disk? If so, maybe the disk has the little black button thing slid into the position to where its contents cant be altered?

  3. #3
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    The executable has been locked by the operating system. You will have to end the process in order to delete it.

  4. #4
    182
    182 is offline
    Registered User
    Join Date
    Oct 2005
    Posts
    133
    When I look in the running processes it doesnt appear to be there, how come the system would lock it, or could it be a pointer fault?

  5. #5
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    What exactly are you trying to delete? It sounded like you are trying to make a program that deletes it's own exe file. If it's not an executable file, then it's possible that another program is using the file, or that there's something wrong in your code
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,699
    if it's a windows application, it could be that you didn't handle some message correctly (WM_CLOSE perhaps?).
    Code:
    bool fun(bool value)
    {
        return std::pow(std::exp(1), std::complex<float>(0, 1) 
        * std::complex<float>(std::atan(1)*(1 << (value + 2))))
        .real() > 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  2. program throws assert after deleting a resource
    By hanhao in forum C++ Programming
    Replies: 3
    Last Post: 04-04-2007, 09:57 PM
  3. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 10:17 PM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

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