PeterMmm Asked: 2012-05-01 00:46:34 +0800 CST2012-05-01 00:46:34 +0800 CST 2012-05-01 00:46:34 +0800 CST Schedule windows command with at 772 What will be the parameter to schedule a program in Windows with the at command to run from Th-Sa, 3am, on even days ? windows-server-2008 scheduled-task 1 Answers Voted Best Answer Bart De Vos 2012-05-01T01:08:27+08:002012-05-01T01:08:27+08:00 I would make a PowerShell script as a "container": 2 options here. You can specify all the "even dates" and check then in a script if today is in the range Th-Sa. at 03:00 /every:2,4,6,8,10,12,14,16,18,20,22,24,26,28,30 "myscript.ps1" Or, you check in your script wether or not your day is even... Function check-even ($num) {[bool]!($num%2)} if(check-even (Get-Date).Day) { Write-Host "Go ahead" } else { Write-Host "Not today!" } Changing the Write-Host's with what you want it to do (and maybe removing the else-clause). Save it somewhere and run it Th-Sa at 3am.
I would make a PowerShell script as a "container":
2 options here.
You can specify all the "even dates" and check then in a script if today is in the range Th-Sa.
Or, you check in your script wether or not your day is even...
Changing the
Write-Host
's with what you want it to do (and maybe removing the else-clause). Save it somewhere and run it Th-Sa at 3am.