Task scheduler doesn't define where the backup is taken, the script you run does.
From what I gather from your question,
- use
sqlcmd[
^] utility to run the SQL scripts
- create one sqlcmd run for the backup and define the backup to be taken where you like
- if necessary add a step in your script where you copy the backup from a location to another
- create one sqlcmd run for the backup and define the restore of the backup to another database
- schedule this script using task scheduler
For defitions for the backup and restore commands to run, please refer to
BACKUP[
^] and
RESTORE[
^]
For sqlcmd see
sqlcmd Utility[
^]