./psexec.exe \\Server “c:\Program Files\Windows Media Player\wmplayer.exe”
start-sleep -seconds 30
$AllCompfiles=get-content compfiles.txt
foreach($file in $AllCompfiles) {
$FilePath=”\\Server\c$\Program Files\Windows Media Player\LOGs\”
#write-host $FilePath$file
if(Test-Path $FilePath$file){
$Lastwritetime=(get-childitem $FilePath$file).lastwritetime
$CurrentTime=get-date
$TimeDiff=($CurrentTime-$Lastwritetime).totalminutes
if($TimeDiff -lt 30) {
write-host “$file is up to date”
}
else{write-host $file is out of date -foreground RED }
}
}
===========Contents of compfiles.txt============
File1
File2
===========Contents of compfiles.txt============