The purpose is to find any new/modified/deleted files. 00tobedeleted is the folder i created in C:\Windows\System32.
When im running following command via CMD:
dir C:\Windows\System32\00tobedeleted /s /b > E:\Database\filepaths.txt
Nothing goes wrong, the file is created, everything is ok.
When I'm trying to do the same in Visual Studio:
system("dir " + path_to_check + "/s /b > " + path_to_save + "filepaths.txt").c_str();
the output is "File Not Found". Maybe it's because of the folder/file rights (when I'm scanning C:\Windows\System32 everything it's alright also). The question is, how can i get the filepaths for all files(hidden also, etc.), with Visual Studio?
path_to_check is obviously "C:\\Windows\\System32\\00tobedeleted "
and path_to_save is "E:\\Database\\"
Main:
#include "database.h"
using namespace std;
int main()
{
string path_to_check = "C:\\Windows\\System32\\00tobedeleted ", path_to_save = "E:\\Database\\", export_path = "E:\\Database\\";
Database database;
database.set_files_checksum(path_to_check, path_to_save);
}
Set checksum:
void Database::set_files_checksum(string path_to_check, string path_to_save)
{
string file;
system(("dir " + path_to_check + "/s /b > " + path_to_save + "filepaths.txt").c_str());
}