How to create a file in windows using VC++ and HIDE IT

simplest way to do that would be:
typeCharStr fileName = L”C:\hiddenFile.txt”;
if(CreateFile( fileName.c_str(),
FILE_READ_DATA,
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
CREATE_NEW,
FILE_ATTRIBUTE_HIDDEN,
NULL ))
printf(“CreateFile failed (%d)n”, GetLastError());
The above is written in C++ using windows API.

Leave a Reply

Your email address will not be published. Required fields are marked *