Description
This article will discuss folder permissions. This article will discuss how to set folder permissions so only an Administrator can access a specific folder. All other users will be denied access.
Solution
This can be done by using the following command:
icacls "C:\Program Files (x86)\Folder" /inheritance:r /grant Administrators:F
Via InstallScript
Steps
- Create a Basic MSI project.
- Create a feature and a component then add files.
- In the General Information View, confirm the folder you want to restrict (for example, INSTALLDIR).
- Create one batch file for the command (Permission.bat) with the following batch file contents:
@echo off title folderpermission icacls "C:\Program Files (x86)\Folder" /inheritance:r /grant Administrators:F echo "Done!" - Navigate to the InstallScript View and add the following InstallScript code in the InstallScript Setup.rul:
#include "ifx.h" export prototype Icacls(HWND); function Icacls(hMSI) // To Do: Declare local variables. STRING szCmdline,szProgram; begin szProgram = "C:\\Users\\Administrator\\Desktop\\Permission.bat"; szCmdline = SystemFolder+"\\cmd.exe /c"; LaunchApp (szProgram,szCmdline); end; - Build the project then run the installer.
- Log in as a non-admin user and check the folder permissions by trying to access the C:\Program Files\Folder folder. Only Administrators will have access to view the contents of the folder.
Via PowerShell
PowerShell Script
Invoke-Expression -Command:"icacls 'C:\Program Files (x86)\Permission' /inheritance:r /grant Administrators:F"
Steps
- Create a Basic MSI project.
- Create a feature and a component then add files.
- In the General Information View, confirm the folder you want to restrict (for example, Permission).
- Create the following PowerShell script with the following contents (test.ps1):
Invoke-Expression -Command:"icacls 'C:\Program Files (x86)\Permission' /inheritance:r /grant Administrators:F" - Configure a PowerShell custom action.
- Build the project then run the installer.
- Only an Administrator will be able to access the C:\Program Files\Permission folder to view the contents of the folder and a non-admin user will not be able to access the C:\Program Files\Permission folder.
Was this helpful?
Related Articles
Dealing With UAC and File-Access Permissions for Non-Administrators Accounts 10Number of Views Why /dev/shm Folder Structure Has World Write Access? 7Number of Views Setting Permissions on Folders in Express 3Number of Views PowerShell script to monitor the log files generated and deleted in a folder 11Number of Views What Files Are Created by the Usage Intelligence SDK and What Is the Folder Location? 14Number of Views
Revenera Assistant
Online
Hi, I am Reva - Ask me anything.
Updates
No new updates
Chat
Home
Updates
/**/
Thanks for the feedback!
Your feedback has been saved.Rate this response:
1
2
3
4
5
Add Additional feedback ( Optional )
0/240
English
English
Language changed successfully
Something went wrong
Email sent successfully
Something went wrong
Case create successfully
Are you sure you want to cancel
the case creation?
Please select a product to submit the case.
Please select a product version to submit the case.
0/255
Upload Attachment
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to cancel the case creation?
Case closed successfully
File Upload
Maximum file size allowed is 3 MB.
File type not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Revenera Assistant
© 2026 Flexera Software. All Rights Reserved.
Case id: 00001065
Activity: Status change: 2 hours ago