File attributes of a shortcut
-
Does anybody know by chance how to change the file attributes of a shortcut in a folder? CFile::Get/SetStatus and GetFileAttributes/SetFileAttributes don't work. Thanks in advance
MS
-
Does anybody know by chance how to change the file attributes of a shortcut in a folder? CFile::Get/SetStatus and GetFileAttributes/SetFileAttributes don't work. Thanks in advance
MS
Manfred Staiger wrote:
CFile::Get/SetStatus and GetFileAttributes/SetFileAttributes don't work.
Why not? What are they (not) doing? This works fine for a shortcut that is on my desktop:
void main( void )
{
char szFile[] = "...\\Desktop\\Survivor.url";
SetFileAttributes(szFile, GetFileAttributes(szFile) | FILE_ATTRIBUTE_READONLY);
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Manfred Staiger wrote:
CFile::Get/SetStatus and GetFileAttributes/SetFileAttributes don't work.
Why not? What are they (not) doing? This works fine for a shortcut that is on my desktop:
void main( void )
{
char szFile[] = "...\\Desktop\\Survivor.url";
SetFileAttributes(szFile, GetFileAttributes(szFile) | FILE_ATTRIBUTE_READONLY);
}
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
It works! I didn't respect that the windows explorer hides the file extension .lnk even if you haven't checked the "hide file extensions" property. So I simply passed the incomplete filename to SetFileAttributes. Anyway, thank you for responding.
MS