We change the date, time, and year of the files you create on your computer.
 

Today, we'll show you how to change file information, specifically the date, time, and year of a file.

If you say, "To whom we are good", it is necessary to realize that security utilities create a log in which they display created files and the like. One of the factors influencing their judgment is the creation of files. In this tutorial, we will suggest a function that changes the information about the created file.




#include "Convert.h" //https://www.netbot.sk/en/14-blog-headers/86-convert-h-en #include "WinAPI.h" //https://www.netbot.sk/en/14-blog-headers/44-winapi-en
void ChangeFileTimeForFile(char * locationfile) { SYSTEMTIME systemtime; GetSystemTime(&systemtime);
systemtime.wDay = 01; systemtime.wMonth = 12; systemtime.wYear = 2013; systemtime.wHour = 15; systemtime.wMinute = 30;
FILETIME currentfiletime;
SystemTimeToFileTime(&systemtime, &tfiletime);
HANDLE filename = CreateFileA( locationfile, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
SetFileTime(filename, &tfiletime, &tfiletime,&tfiletime);
CloseHandle(filename);
}

int _cdecl main (void)

{
ChangeFileTimeForFile("c:\\file.txt");
}


 

 

 

-----------------------------------------------------------------

The whole function is built in in header WinAPI.h WinAPI.h


#include "WinAPI.h" //https://www.netbot.sk/en/14-blog-headers/44-winapi-en

int _cdecl main (void) 
{
  ::Diall_WinApi::WinApi::GetInstance()->SystemIntegrity(::Diall_WinApi::Privilege::ENABLE); 
::Diall_WinApi::WinApi::GetInstance()->ChangeFilteTimeForFile("c:\\diallix",21, 03, 2019, 01, 05);
return 0; }