Folder Protection Software in C Programming

CWC
2 Min Read

This is a Folder Protection Software in C which is compatible with Win98, WinNT, Win2000 Server. Will not work on Win XP. By this software convert your folder to Control panel using protection option. And restore it by using unprotected option.

At first, I declared some variables, array and File instance. Then I opened a file Named “a.bat” with write mode and checking if the file can be opened or not. This Software can convert your File/Folder to Control Panel and can restore again.

Then it ask the user to enter file or folder path and then ask 2 options. Using switch case, we can check which option user selected. After then it ask to Enter name of the file or folder and then using strcat() function, it concatenate Two char array. After concatenating, full char array puts in file “a.bat” file. When Closing the program, it removes that file.

Download Free Folder Protection Software in C Programming Source Code

#include<stdio.h>
#include<string.h>
#include<process.h>

void main()
{
    FILE *p;
    char ch,s[100];
    char r[100]="REN ";
    char u[]=".{21EC2020-3AEA-1069-A2DD-08002B30309D} ";
    char v[50];
    int choice,i;
    p=fopen("a.bat","w+");
    if(p==NULL)
    {
        printf("Error in opening the file a.c");
        exit(0);
    }
    printf("This software can convert your File/Folder to Control Panel and can Restore again.");
    printf("\nEnter the path of the file: ");
    fflush(stdin);
    gets(s);
    for(i=0; i<25; i++)
        fputs("\nThis software is not responsible for any loss in data",p);
    printf("\nEnter choice :");
    printf("\n1.Protect Folder/File");
    printf("\n2.Unprotect folder/File");
    printf("\n3.Exit\n");
    scanf("%d",&choice);

    switch(choice)
    {
    case 1:
        strcat(r,s);
        printf("\nEnter new name of your folder/file: ");
        fflush(stdin);
        gets(v);
        strcat(r," ");
        strcat(r,v);
        strcat(r,u);
        break;
    case 2:
        strcat(r,s);
        strcat(r,u);
        printf("\nEnter new name of your folder/file: ");
        fflush(stdin);
        gets(v);
        strcat(r,v);
        break;
    default:
        fclose(p);
        remove("a.bat");
        exit(0);
    }
    fputs(r,p);
    for(i=0; i<25; i++)
        fputs("\nThis software is not responsible for any loss in data",p);
    fputs("exit",p);

    fclose(p);

    system("a.bat");

    remove("a.bat");

    return 0;
}

Download Free Folder Protection Software in C Programming Source Code

Folder-Protection-Software-in-C-Programming-CodeWithC

Share This Article
1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

English
Exit mobile version