fortran_guy
2011-04-01 18:42:50 UTC
Windows 7 32 bit but the intended target is a Windows Server 2008 R2
as an inbound and outbound FTP server. I've run Set-ExecutionPolicy
unrestricted, set it to run with gpedit.msc, and both RSOP.MSC and
sysinternals AUTORUNS show it running through local group
policy. .ps1 is associated with PowerShell, the script is in c:
\windows\system32\grouppolicy\machine\scripts\startup (which I believe
is the default location) and the file even shows under the PowerShell
"Show Files" button. So what tweaks/changes/etc. am I missing.
The script is:
# Check for changes every 60 seconds
$currentFiles = Get-ChildItem D:\inetpub\ftproot\localuser\username
\UNEDITEDIMAGES
while(-1){
$newFiles = Get-ChildItem D:\inetpub\ftproot\localuser\username
\UNEDITEDIMAGES
if($newFiles.count -ne $currentFiles.count){
$currentFiles = $newFiles
(new-object Media.SoundPlayer "C:\WINDOWS\Media\notify.wav").play()
}
Start-Sleep(60)
}
as an inbound and outbound FTP server. I've run Set-ExecutionPolicy
unrestricted, set it to run with gpedit.msc, and both RSOP.MSC and
sysinternals AUTORUNS show it running through local group
policy. .ps1 is associated with PowerShell, the script is in c:
\windows\system32\grouppolicy\machine\scripts\startup (which I believe
is the default location) and the file even shows under the PowerShell
"Show Files" button. So what tweaks/changes/etc. am I missing.
The script is:
# Check for changes every 60 seconds
$currentFiles = Get-ChildItem D:\inetpub\ftproot\localuser\username
\UNEDITEDIMAGES
while(-1){
$newFiles = Get-ChildItem D:\inetpub\ftproot\localuser\username
\UNEDITEDIMAGES
if($newFiles.count -ne $currentFiles.count){
$currentFiles = $newFiles
(new-object Media.SoundPlayer "C:\WINDOWS\Media\notify.wav").play()
}
Start-Sleep(60)
}