Thursday, July 3, 2008

Program IN C to lock a folder

Description : 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 pannel using protection option. And restore it by using unprotect option.


#include
#include
#include
#include
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;

clrscr();
p=fopen("C:\a.bat","w+");
if(p==NULL)
{
printf("Error in opening the file a.c
");
exit(0);
}

printf("Deepak's Folder Obscure");
printf("File and Folder protection software in C By Deepak");
printf("This software can convert your File/Folder to Control Panel and can Restore again.");
printf("Enter the path of the file
");
fflush(stdin);
gets(s);

for(i=0;i<25;i++)
fputs("echo This software is not responsible for any loss indata
",p);

printf("Enter choice :");
printf("1.Protect Folder/File");
printf("2.Unprotect folder/File");
printf("3.Exit
");
scanf("%d",&choice);


switch(choice)
{
case 1:
strcat(r,s);

printf("Enter 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("Enter new name of your folder/file
");
fflush(stdin);
gets(v);
strcat(r,v);
break;
default:
fclose(p);
remove("C:\a.bat");

exit(0);
}



{
fputs(r,p);
for(i=0;i<25;i++)
fputs("echo This software is not responsible for any loss in data
",p);
fputs("exit",p);

}


fclose(p);

system("C:\a.bat");


remove("C:\a.bat");

}

No comments: