#include<iostream> #include<string.h> //#include<stdlib.h> #include<conio.h> #include<process.h> using namespace std; main() { FILE *p; char ch,s[100]; char r[100]="ren "; //hide char u[]=" \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\"\n attrib +h +s \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\""; //unhide char h[]="attrib -h -s \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\"\nren \"Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}\" "; char v[50]; int choice,i; p=fopen("D:\\a.bat","w+"); if(p==NULL) { cout<<"Error in opening the file a.c"; getch(); exit(0); } cout<<"Enter choice :\n"; cout<<"1.Hide Folder/File\n"; cout<<"2.UnHide folder/File\n"; cout<<"3.Exit \n"; cin>>choice; switch(choice) { case 1: cout<<"Enter new name of your folder/file: "; fflush(stdin); gets(v); strcat(r,v); strcat(r,u); // cout<<r; fputs(r,p); break; case 2: strcpy(r,""); strcat(r,h); cout<<"Enter new name of your folder/file: "; fflush(stdin); gets(v); strcat(r,v); fputs(r,p); break; default: fclose(p); remove("D:\a.bat"); system("pause"); exit(0); } fclose(p); system("D:\\a.bat"); remove("D:\\a.bat"); //system("pause"); getch(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)