set user="IUSR"
REM IIS Express will always run the above. Full IIS is configurable, but defaults to this built-in account also

REM Note that wildcards are not allowed for directories, only files

icacls adminzone\pages\comcode_custom\EN /grant %user%:(M)
icacls adminzone\pages\comcode_custom\EN\*.txt /grant %user%:(M)
icacls adminzone\pages\html_custom\EN /grant %user%:(M)
icacls adminzone\pages\html_custom\EN\*.htm /grant %user%:(M)
icacls caches\* /grant %user%:(M)
icacls caches\lang\EN /grant %user%:(M)
icacls caches\lang\EN\*.lcd /grant %user%:(M)
icacls cms\pages\comcode_custom\EN /grant %user%:(M)
icacls cms\pages\comcode_custom\EN\*.txt /grant %user%:(M)
icacls cms\pages\html_custom\EN /grant %user%:(M)
icacls cms\pages\html_custom\EN\*.htm /grant %user%:(M)
icacls collaboration\pages\comcode_custom\EN /grant %user%:(M)
icacls collaboration\pages\comcode_custom\EN\*.txt /grant %user%:(M)
icacls collaboration\pages\html_custom\EN /grant %user%:(M)
icacls collaboration\pages\html_custom\EN\*.htm /grant %user%:(M)
icacls data_custom\errorlog.php /grant %user%:(M)
icacls data_custom\firewall_rules.txt /grant %user%:(M)
icacls data_custom\modules\admin_backup /grant %user%:(M)
icacls data_custom\modules\admin_backup\* /grant %user%:(M)
icacls data_custom\modules\admin_stats /grant %user%:(M)
icacls data_custom\modules\admin_stats\* /grant %user%:(M)
icacls data_custom\modules\chat /grant %user%:(M)
icacls data_custom\modules\chat\* /grant %user%:(M)
icacls data_custom\modules\web_notifications /grant %user%:(M)
icacls data_custom\modules\web_notifications\* /grant %user%:(M)
icacls data_custom\sitemaps /grant %user%:(M)
icacls data_custom\sitemaps\* /grant %user%:(M)
icacls data_custom\spelling\personal_dicts /grant %user%:(M)
icacls data_custom\spelling\personal_dicts\* /grant %user%:(M)
icacls data_custom\xml_config /grant %user%:(M)
icacls data_custom\xml_config\*.xml /grant %user%:(M)
icacls exports\addons /grant %user%:(M)
icacls exports\addons\*.tar /grant %user%:(M)
icacls exports\backups/grant %user%:(M)
icacls exports\backups /grant %user%:(M)
icacls exports\backups\* /grant %user%:(M)
icacls exports\file_backups /grant %user%:(M)
icacls exports\file_backups\* /grant %user%:(M)
icacls forum\pages\comcode_custom\EN /grant %user%:(M)
icacls forum\pages\comcode_custom\EN\*.txt /grant %user%:(M)
icacls forum\pages\html_custom\EN /grant %user%:(M)
icacls forum\pages\html_custom\EN\*.htm /grant %user%:(M)
icacls imports\addons /grant %user%:(M)
icacls imports\addons\*.tar /grant %user%:(M)
icacls lang_custom /grant %user%:(M)
icacls lang_custom\EN /grant %user%:(M)
icacls lang_custom\EN\*.ini /grant %user%:(M)
icacls pages\comcode_custom\EN /grant %user%:(M)
icacls pages\comcode_custom\EN\*.txt /grant %user%:(M)
icacls pages\html_custom\EN /grant %user%:(M)
icacls pages\html_custom\EN\*.htm /grant %user%:(M)
icacls safe_mode_temp /grant %user%:(M)
icacls safe_mode_temp\* /grant %user%:(M)
icacls site\pages\comcode_custom\EN /grant %user%:(M)
icacls site\pages\comcode_custom\EN\*.txt /grant %user%:(M)
icacls site\pages\html_custom\EN /grant %user%:(M)
icacls site\pages\html_custom\EN\*.htm /grant %user%:(M)
icacls text_custom /grant %user%:(M)
icacls text_custom\*.txt /grant %user%:(M)
icacls text_custom\EN /grant %user%:(M)
icacls text_custom\EN\*.txt /grant %user%:(M)
icacls themes /grant %user%:(M)
icacls themes\default\css_custom /grant %user%:(M)
icacls themes\default\css_custom\*.css /grant %user%:(M)
icacls themes\default\images_custom /grant %user%:(M)
icacls themes\default\images_custom\* /grant %user%:(M)
icacls themes\default\javascript_custom /grant %user%:(M)
icacls themes\default\javascript_custom\*.js /grant %user%:(M)
icacls themes\default\templates_cached\EN /grant %user%:(M)
icacls themes\default\templates_cached\EN\* /grant %user%:(M)
icacls themes\default\templates_custom /grant %user%:(M)
icacls themes\default\templates_custom\*.tpl /grant %user%:(M)
icacls themes\default\xml_custom /grant %user%:(M)
icacls themes\default\xml_custom\*.xml /grant %user%:(M)
icacls themes\default\text_custom /grant %user%:(M)
icacls themes\default\text_custom\*.txt /grant %user%:(M)
icacls themes\default\theme.ini /grant %user%:(M)
icacls themes\admin\css_custom /grant %user%:(M)
icacls themes\admin\css_custom\*.css /grant %user%:(M)
icacls themes\admin\images_custom /grant %user%:(M)
icacls themes\admin\images_custom\* /grant %user%:(M)
icacls themes\admin\javascript_custom /grant %user%:(M)
icacls themes\admin\javascript_custom\*.js /grant %user%:(M)
icacls themes\admin\templates_cached\EN /grant %user%:(M)
icacls themes\admin\templates_cached\EN\* /grant %user%:(M)
icacls themes\admin\templates_custom /grant %user%:(M)
icacls themes\admin\templates_custom\*.tpl /grant %user%:(M)
icacls themes\admin\xml_custom /grant %user%:(M)
icacls themes\admin\xml_custom\*.xml /grant %user%:(M)
icacls themes\admin\text_custom /grant %user%:(M)
icacls themes\admin\text_custom\*.txt /grant %user%:(M)
icacls themes\admin\theme.ini /grant %user%:(M)
icacls themes\map.ini /grant %user%:(M)
icacls uploads\* /grant %user%:(M)
icacls uploads\attachments\* /grant %user%:(M)
icacls uploads\attachments_thumbs\* /grant %user%:(M)
icacls uploads\auto_thumbs\* /grant %user%:(M)
icacls uploads\banners\* /grant %user%:(M)
icacls uploads\catalogues\* /grant %user%:(M)
icacls uploads\cns_avatars\* /grant %user%:(M)
icacls uploads\cns_cpf_upload\* /grant %user%:(M)
icacls uploads\cns_photos\* /grant %user%:(M)
icacls uploads\cns_photos_thumbs\* /grant %user%:(M)
icacls uploads\downloads\* /grant %user%:(M)
icacls uploads\filedump\* /grant %user%:(M)
icacls uploads\galleries\* /grant %user%:(M)
icacls uploads\galleries_thumbs\* /grant %user%:(M)
icacls uploads\personal_sound_effects\* /grant %user%:(M)
icacls uploads\repimages\* /grant %user%:(M)
icacls uploads\watermarks\* /grant %user%:(M)
icacls uploads\website_specific\* /grant %user%:(M)
icacls _config.php /grant %user%:(M)

pause
