' Based on the attribute Select Case nAttribute ' Readonly Case FileAttribute.ReadOnly ' If we have to add it If lAttribute Then File.SetAttributes(cFile, loFileAttribute And FileAttributes.ReadOnly) Else File.SetAttributes(cFile, loFileAttribute And Not FileAttributes.ReadOnly) End If ' System Case FileAttribute.System ' If we have to add it If lAttribute Then File.SetAttributes(cFile, loFileAttribute And FileAttributes.System) Else File.SetAttributes(cFile, loFileAttribute And Not FileAttributes.System) End If ' Hidden Case FileAttribute.Hidden ' If we have to add it If lAttribute Then File.SetAttributes(cFile, loFileAttribute And FileAttributes.Hidden) Else File.SetAttributes(cFile, loFileAttribute And Not FileAttributes.Hidden) End If End SelectThe code goes in the right line but it has not effect on the file properties.