Hi,
I'm having the following Powershell script to monitor for a File creation event:
$folder = 'D:\LoadTesting2' $filter = 'runTest.bat' $fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $false;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'} Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action { Start-process D:\LoadTesting2\runTest.bat}
I want this Powershell script to execute during system startup itself. Where do I place this file so that it starts monitoring for the file creation event as soon as the system gets started, any execution policies needs to be added? Also, I want to place this script to that corresponding folder remotely as well through Powershell. Is that possible?
I tried placing this script in "C:\Documents and Settings\saravind\Start Menu\Programs\Startup" but as soon as the system starts up, Powershell script opens up in a notepad. :(
Thanks in advance
-Aravind