Quantcast
Channel: CobianSoft
Viewing all articles
Browse latest Browse all 4265

Cobian Reflector • Re: Run backup on shutdown

$
0
0
Running a backup task every time you shut down your computer using the standard Windows shutdown method (Windows button - Shutdown) can be a bit more challenging compared to running a task on user logoff.
Flappy Bird
By default, the Windows shutdown process does not provide a built-in mechanism to trigger tasks during shutdown. However, you can try the following workaround using a batch file and Group Policy settings:

Create a batch file: Create a batch file (e.g., backup_and_shutdown.bat) that includes the commands to run your backup task and initiate the system shutdown.
Replace `my_backup_command.exe` with the actual command or script that performs your backup task.

2. Use Group Policy: To configure the shutdown process to run this batch file, you can use Group Policy settings. Here's how:

a. Press Win + R to open the Run dialog, then type `gpedit.msc` and press Enter. This will open the Local Group Policy Editor.

b. In the Group Policy Editor, navigate to "Computer Configuration" -> "Windows Settings" -> "Scripts (Startup/Shutdown)".

c. Double-click on "Shutdown" in the right pane.

d. In the Shutdown Properties window, click "Add" to add a new script.

e. Browse and select the batch file you created (backup_and_shutdown.bat).

f. Click "OK" to save the changes.

3. Test the setup: Now, when you shut down your computer using the standard Windows shutdown method, the batch file will run your backup task before initiating the system shutdown.
cobiansoft.png

Statistics: Posted by alishakihn — 09 Aug 2023, 06:00



Viewing all articles
Browse latest Browse all 4265

Trending Articles