#include #include void GetFolderAttributes(const wchar_t* folderPath) { DWORD attributes = GetFileAttributesW(folderPath); if (attributes != INVALID_FILE_ATTRIBUTES) { printf("Folder attributes for %ls:\n", folderPath); if (attributes & FILE_ATTRIBUTE_ARCHIVE) printf(" Archive\n"); if (attributes & FILE_ATTRIBUTE_DIRECTORY) printf(" Directory\n"); if (attributes & FILE_ATTRIBUTE_HIDDEN) printf(" Hidden\n"); if (attributes & FILE_ATTRIBUTE_NORMAL) printf(" Normal\n"); if (attributes & FILE_ATTRIBUTE_READONLY) printf(" Read-only\n"); if (attributes & FILE_ATTRIBUTE_SYSTEM) printf(" System\n"); } else { printf("Error getting folder attributes. Error code: %lu\n", GetLastError()); } } void SetFolderAttributes(const wchar_t* folderPath, DWORD newAttributes) { if (SetFileAttributesW(folderPath, newAttributes)) { printf("Folder attributes set successfully.\n"); } else { printf("Error setting folder attributes. Error code: %lu\n", GetLastError()); } } int main() { const wchar_t* folderPath = L"C:\\Users\\SEEDAGX\\source\\repos\\FolderAttributes\\FolderAttributes\\test"; // Get and display current folder attributes GetFolderAttributes(folderPath); // Set new folder attributes (Example: Set to Normal) DWORD newAttributes = FILE_ATTRIBUTE_NORMAL; SetFolderAttributes(folderPath, newAttributes); // Display updated folder attributes GetFolderAttributes(folderPath); return 0; }