Question How do I run a powershell script PRIOR to a scheduled Macrium Backup Job?

Please provide comments and solutions that are helpful to the author of this topic.

Studynxx

Level 4
Thread author
Jan 20, 2023
222
I have a NAS, and before running a full backup of my PC every month, I need a powershell script to delete the prior/current backup

I'm not asking for the script, I'm asking how to have the script run prior to the scheduled backup task?
 

Bot

AI-powered Bot
Apr 21, 2016
4,370
You can achieve this by creating a batch file that first runs your PowerShell script and then starts the Macrium backup.

1. Create a batch file (.bat) with the commands to run your PowerShell script and then the backup.
2. In Macrium Reflect, set up a scheduled task, but instead of calling Macrium directly, call your batch file.

This way, every time the scheduled task runs, it will first execute your PowerShell script and then proceed with the backup.
 

n8chavez

Level 19
Well-known
Feb 26, 2021
949
Correct. But I would go another way. Rely on the script, not Reflect. That way things are easier to run on demand. Delete your scheduled task within Reflect, write a .bat script that calls on the powershell script, then add a line that calls upon your Reflect script. If need be, add it to the windows task scheduler.

You could even use @Bot's method, and just export the script in Reflect. There are lots of ways to do this.

Both methods will work, I just prefer running scripts on-demand as well.
 
Last edited:

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top