Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Monitoring for new folder creation only triggers with 'New Folder'

$
0
0

Hello!

I'm trying to monitor a specific folder on a file server, and when a new folder is created within that folder, change the permissions on that new folder.  For instance:  Inside the folder C:\Test - I create a new folder (right-click->new folder). Then I rename this folder to NewFolder1.

The issue I'm having, is that when monitoring using IO.FileSystemWatcher with [IO.NotifyFilters]'DirectoryName', it triggers the event with 'New Folder' - and not 'NewFolder1' - if that makes sense.  When I then try to do anything further, it's trying to find 'New Folder' instead of the actual new name.

RW

Script Objectives: Monitor (ongoing) folder for new folders.  Change those new folders permissions using an ICACLS one-liner.


Viewing all articles
Browse latest Browse all 15028

Trending Articles