DFM1009

New Member
Joined
Nov 22, 2013
Messages
1
I need to create a script that deny's all privilages to a folder for all users. the program runs from a hidden directory under individual user accounts is the tricky thing. example User A: did not install the program and cannot see that the program is installed. User B: installed the program and the EXE is on the desktop as well as the start bar. ADMIN login: cannot see the EXE unless view hidden files is enabled and dill down to App Data in specific user account. Is such a script even possible? The PC's i am attempting to make this cange on are used by several different users with several different login's.
 


Solution
Creating a script to deny all privileges to a folder for all users, especially when the program runs from a hidden directory under individual user accounts, can be a bit complex but is generally possible. Here's an outline of how you could approach this:
  1. Identify the Directory: You'll need to locate the hidden directory where the program is installed. Typically, programs store their executables and data in specific directories or in the "AppData" folder for each user.
  2. Script Execution: The script can be executed with administrative privileges to ensure that it can make changes to system files and folders.
  3. Modify Permissions: Using PowerShell or Command Prompt commands, you can modify the permissions of the...
Creating a script to deny all privileges to a folder for all users, especially when the program runs from a hidden directory under individual user accounts, can be a bit complex but is generally possible. Here's an outline of how you could approach this:
  1. Identify the Directory: You'll need to locate the hidden directory where the program is installed. Typically, programs store their executables and data in specific directories or in the "AppData" folder for each user.
  2. Script Execution: The script can be executed with administrative privileges to ensure that it can make changes to system files and folders.
  3. Modify Permissions: Using PowerShell or Command Prompt commands, you can modify the permissions of the folder to deny access to all users.
  4. Scheduled Task: To ensure that this script runs whenever a user logs in, you could create a scheduled task that triggers the script to deny permissions to the folder.
  5. Testing and Deployment: Before deploying this script on all PCs, thorough testing is crucial to ensure that it works as intended without causing unexpected issues. While the script itself will vary depending on the specifics of your setup, here is a brief example of what the script might look like in PowerShell:
    Code:
    # Specify the path to the hidden directory where the program is installed $folderPath = "C:\Users\UserA\AppData\YourHiddenDirectory" # Remove all permissions for all users on the folder $acl = Get-Acl $folderPath $acl.SetAccessRuleProtection($true, $false) Set-Acl $folderPath $acl
    Make sure to replace "C:\Users\UserA\AppData\YourHiddenDirectory" with the actual path to the hidden directory where the program is installed. It's important to note that modifying system permissions can have unintended consequences, so it's recommended to test this on a single PC first before rolling it out to multiple PCs. Additionally, it's crucial to have backups in place in case something goes wrong during the process.
 


Solution
Back
Top