Here is an example program document you can use. Make sure the Notes directory is in your system PATH.
Basics
Program name: $COMPACT.EXE
Command line: -S 5
Server to run on: ServerName/Domain
Comments: Compact databases with more than 5 percent whitespace.
Schedule
Enabled/disabled: ENABLED
Run at times: 10:10 PM each day
Repeat interval of: 0 minutes
Days of week: Wed, Sat
Note that if you are running DAOS in Domino 8.x+, you'll have to add the -B flag for the database to shrink free space properly.