Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Powershell script that scans every x minutes and if there is a new folder/file inside a folder, it sets it (and its contents) to read only

$
0
0

Say I have a folder in D:/Thisfolder (also at serverthisfolder)

If I insert a “newfolder” in there ( D:/Thisfolder/newfolder) or a new file hello.txt, for the folder I should set the folder “newfolder” and all its contents as read only. Also for the new file in D:/Thisfolder/hello.txt, it should be set as read only.

Also this should check “D:/Thisfolder” either every x minutes and/or when it detects a change inside.

submitted by /u/vmeverything
[link] [comments]

The post Powershell script that scans every x minutes and if there is a new folder/file inside a folder, it sets it (and its contents) to read only appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images