I'm doing a folder locker that works like the .bat notepad file.
If I put the password inside the .cpp file, it works perfectly. But I wanna put the password when running the program.
To do that, I tried to create a .dat file that save the password as a string. Then, it'll be hidden and appear when is needed to check the password the user entered.
The problem is that, after creating the file and adding the password, it show me that the final file wasn't found.
checkDir("Private.{21EC2020-3AEA-1069-A2DD-08002B30309D}");
// This will check if the file in parenthesis exists
checkDir("Private");
// This will check if the file in parenthesis exists
string password;
fstream passwordSave;
if (checkDir("Private") == false && checkDir("Private.{21EC2020-3AEA-1069-A2DD-08002B30309D}") == false)
// false = doesn't exists
{
system("md Private");
// This will create the directory to add the itens to be hidden
cout << "Insert the password: ";
cin >> password;
passwordSave.open("Password.dat"); // The file to save the pass
passwordSave << password;
MoveFile("Password.dat", "Password.{21EC2020-3AEA-1069-A2DD-08002B30309D}.dat")
// I REALLY DON'T KNOW IF THE SYNTAX IS CORRECT --> Maybe this is the problem?
system("attrib +h Password.{21EC2020-3AEA-1069-A2DD-08002B30309D}.dat");
// This file isn't found
return 0;
}