Thread: delete file

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    5
    Rep Power
    0

    delete file


    #include<stdio.h>
    #include<stdlib.h>
    #include<windows.h>

    int main(int argc, char** argv[]){

    typedef char string[1001];
    string file;

    // it Sets the title of console
    SetConsoleTitle("File Deleter ");

    // it shows one message box
    MessageBox(0,"Welcome to File Deleter","Info",MB_ICONINFORMATION);

    printf("Write the name or the way of file for delete: ");
    gets(file);


    /*
    the function returns 1 when executed correctly . . .
    */
    int a = DeleteFile(file);

    if(!a) // or if(a==0)
    {
    printf("Error: File \"%s\" not found\n\n",file);
    }
    else
    {
    printf("File \"%s\" Deleted Sucessfully . . . .\n",file);
    }
    getch();
    }
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Location
    India
    Posts
    95
    Rep Power
    4
    what are you doing???
    if you have any problem then post here..

IMN logo majestic logo threadwatch logo seochat tools logo