Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What will be the parameter to schedule a program in Windows with the at command to run from Th-Sa, 3am, on even days ?

share|improve this question
    
What version of Windows? –  Chopper3 Apr 30 '12 at 8:48
    
Windows Server 2008 –  PeterMmm Apr 30 '12 at 8:53
2  
Not tempted to use the scheduler? –  Chopper3 Apr 30 '12 at 9:22
1  
IMHO for casual use it is over-engineered, too much panels, too much buttons, too much right-clicks, ... yes I'm a *nix admin. Thanks. –  PeterMmm Apr 30 '12 at 9:36
add comment

1 Answer

up vote 3 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.