Share via

Writing powershell script to allow apps through Controlled Folder Access

Zheli Zheng 101 Reputation points
2022-06-30T00:27:03.727+00:00

Hi,

I have been trying to write a script to allow programs such as Paint, Screen Snippet, etc. to save to protected folders.

However, I found it strange that while %UserProfile%\Documents is protected by default %UserProfile%\Desktop is not. Does not user store many of his personal files on Desktop?

Also if we are to allow a program such as Paint using the script

Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Program Files\WindowsApps\dotPDNLLC.paint.net_4.19.6484.0_x64__h55e3w7q8jbva\PaintDotNet.exe"...

What if the version number changes, in that case the path will change too right? Then do we need to re-run the script with new version number?

Can anyone answer these questions please?

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.