用函数SetFileInfo即可实现该功能:
// 更改安装目录 svPath 系统属性
nType = FILE_ATTRIBUTE;
nResult = FILE_ATTR_READONLY;
szResult = "";
if (SetFileInfo(svPath, nType, nResult, szResult) < 0) then
szMsg = "设置目录只读属性错误!!!";
nType = SEVERE;
MessageBox(szMsg, nType );
else
szMsg = "设置目录只读属性成功!!!";
nType = INFORMATION;
MessageBox(szMsg, nType );
endif;