This example Powershell script finds the latest file in a folder and uploads it to a server, scheduled to run periodically. Powershell is version 1 or 2. With higher versions, some commands may use a different syntax. c:\temp\scpnewfile.ps1: cd C:\Users\theuser\Documents\theapp\Pictures $newfile = dir | sort-object lastwritetime -desc | select-object -first 1 pscp -pw thepassword $newfile.name theuser@thehost:. powershell set-executionpolicy remotesigned powershell -f scpnewfile.ps1 schtasks /create /sc minute /mo 5 /tn YongTest /tr "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe c:\temp\scpnewfile.ps1" schtasks /tn YongTest schtasks /query /v /tn YongTest <-- may as well use Task Scheduler GUI schtasks /change /disable /tn YongTest schtasks /change /enable /tn YongTest c:\windows\system32\tasks\YongTest