Share via

Windows 10 Shutdown script not performing Windows backup

Anonymous
2019-12-31T04:17:49+00:00

This script performed under Windows 7 Pro perfect for years.

Group Policy etc. is modified to run the script on shutdown (see script).

Now I changed to Windows 10 Pro (new hardware) and got into one Problem.

Running the script with adminrights while logged in works fine.

Running the script on shutdown the script starts well but when it comes to ...

The lines where the task scheduler is modified result with success ("C:\Windows\System32\schtasks.exe … "Microsoft\Windows\WindowsBackup\AutomaticBackup"").

But the backup seems to be not started and the processes VSSVC.exe and wbadmin.exe are not active.

After starting Windows again there is no message that the backup was interrupted.

Is there someone having any ideas?

SCRIPT:

@echo off

REM ================================

REM Notwendige Windows-Einstellungen

REM ================================

REM Script beim Herunterfahren ausführen

REM lokale Gruppenrichrtlinien (gpedit.msc) > Computerkonfiguration > Windows-Einstellungen > Skripts (Start/Herunterfahren) > Herunterfahren > Eigenschaften > Scripts > Hinzufügen > "D:\1Daten\MyProgs\ShutdownBackup\ShutdownBackup.cmd"

REM wenn zusätzlich bei jedem Shutdown ein Systemwiederherstellungspunkt erstellt werden soll entsprechende Zeile in diesem Script aktivieren (Dauer ca. 5 Minuten)

REM

REM Script sichtbar machen

REM lokale Gruppenrichrtlinien (gpedit.msc) > Computerkonfiguration > Administrative Vorlagen  > System > Skripts > Anweisungen in Abmeldeskripts während der Ausführung anzeigen > Aktiviert

REM

REM Script Wartezeit anpassen

REM lokale Gruppenrichrtlinien (gpedit.msc) > Computerkonfiguration > Administrative Vorlagen  > System > Skripts > Maximale Wartezeit für Script ... > 600s => 12000s

REM

REM Energieoptionen anpassen

REM Systemsteuerung > Energieoptionen > Auswählen, was beim Drücken des Netzschalters geschehen soll > Einige Einstellungen sind momentan nicht verfügbar  > Schnellstart aktivieren > deaktivieren

REM ================================

ECHO =========================================

ECHO Energiesparmodus "Hoechstleistung" setzen

ECHO =========================================

powercfg /S "8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"

ECHO.

ECHO.

ECHO ===================================================

ECHO Backup "Datensicherung der Aufgabenplanung starten"

ECHO ===================================================

ECHO AutomaticBackup /ENABLE

C:\Windows\System32\schtasks.exe /CHANGE /TN "Microsoft\Windows\WindowsBackup\AutomaticBackup" /ENABLE

ping -n 10 localhost>NUL

ECHO.

ECHO AutomaticBackup /RUN

C:\Windows\System32\schtasks.exe /RUN /TN "Microsoft\Windows\WindowsBackup\AutomaticBackup"

ping -n 10 localhost>NUL

ECHO.

ECHO AutomaticBackup /DISABLE

C:\Windows\System32\schtasks.exe /CHANGE /TN "Microsoft\Windows\WindowsBackup\AutomaticBackup" /DISABLE

ECHO.

ECHO 10s warten, Prozess (VSSVC.exe) wird gestartet ...

ping -n 10 localhost>NUL

:SICHERUNG_AKTIV

ECHO Warten bis Prozess (VSSVC.exe) beendet wird ...

:LOOP1

tasklist|findstr /i "VSSVC.exe">NUL && (ping -n 10 localhost>NUL & goto:LOOP1)

ECHO Prozess (VSSVC.exe) beendet

ECHO.

ECHO.

echo Datensicherung beendet

ECHO.

ECHO.

ping -n 10 localhost>NUL

ECHO Warten bis Prozess (wbadmin.exe) beendet wird ...

:LOOP2

tasklist|findstr /i "wbadmin.exe">NUL && (ping -n 10 localhost>NUL & goto:LOOP2)

ECHO Prozess (wbadmin.exe) beendet

ECHO.

ECHO.

echo Systemabbild aktualisieren beendet

ECHO.

ECHO.

ECHO =======================================

ECHO Energiesparmodus "Ausbalanciert" setzen

ECHO =======================================

powercfg /S "381b4222-f694-41f0-9685-ff5bb260df2e"

ECHO.

ECHO.

rem pause

GOTO ENDE

:ABBRUCH

echo Sicherung abgebrochen

ECHO.

ECHO.

:ENDE

ping -n 5 localhost>NUL

EXIT

Windows for home | Windows 10 | Performance and system failures

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

10 answers

Sort by: Most helpful
  1. Anonymous
    2019-12-31T05:42:03+00:00

    Greg, please stop giving answers to not raised Questions. Thanks.

    Any advice to my Question in the first post are higly welcome.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2019-12-31T05:45:26+00:00

    I've helped over 100,000 customers over ten years daily in forums and no more than 10 have ever complained when I gave them extra advice based on helping more people if tech forums than anyone else.

    As I said I've helped countless others attempt to recover files lost by Windows backup programs so would be remiss not to warn others about it, and will continue to do so.

    Have a nice day.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-12-31T04:59:20+00:00

    Markus, be aware File History, Windows file and Image backup in Windows 10 are dysfunctional and may be phased out in a future version. They're not the best choices anyway because after ten years in forums I've seen countless times that files are lost trying to restore them, so feel obligated to recommend choices that work better and are more reliable.

    The safest and most reliable backup method is to sort your files into their User Folders (Documents, Desktop, Pictures, Downloads, etc) and periodically drag or copy them to external or another hard drive. See tips for copying large groups of files here: https://www.pcworld.com/article/2086566/the-man...

    Then have one other Cloud backup so your files are safe from fire and theft and easily accessible via the internet just like email. Some suggestions to help ease into this habit:

    You can drag or copy 5gb for free into OneDrive app to store in the cloud where they are safe from fire and theft. You can also choose to sync the Desktop, Pictures and Documents folders (only) in OneDrive app Settings > Backup for real time backup. More here: https://www.tenforums.com/tutorials/116029-turn...

    If you install Google Drive, you can use their new Backup to choose ANY User folders (Documents, Pictures, etc.) to sync up to 15g for free to their cloud in real time. You can also drag/copy selected files into Drive folder. More here:

    https://www.blog.google/products/photos/introdu...

    Besides your files you should back up a System Image to use in place of reinstall in 20 minutes. The best free alternative is Macrium: http://www.howtogeek.com/howto/7363/macrium-ref....

    There is an easy way to mount the System Image to extract files if needed. Some prefer to move their User folders off of C to make the image smaller and so they stay current if you need to re-image C. Here's how: http://www.dummies.com/computers/operating-syst...

    This way if Windows ever becomes irreparable you can restore C in 20 minutes from recovery media, and your files will be current and safe in their own separate partition. If they are left on C they will be dated from when the image was taken.

    I hope this helps.

    ________________________________________________________

    Standard Disclaimer: There are links to non-Microsoft websites. The pages appear to be providing accurate, safe information. Watch out for ads on the sites that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the sites before you decide to download and install it.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2019-12-31T04:51:29+00:00

    Hi Greg, thanks for the link.

    I don't want to use robocopy but use Windows backup because of System files etc.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2019-12-31T04:31:26+00:00

    Hi Markus. I'm Greg, an installation specialist, 10 year Windows MVP, and Volunteer Moderator here to help you.

    There's a good working script for running backup in Windows 10 at shutdown here:

    https://www.techrepublic.com/article/how-to-bac...

    I hope this helps. Feel free to ask back any questions and keep me posted. If you will wait to choose if I solved your problem, I will keep working with you until it's resolved.

    ________________________________________________________

    Standard Disclaimer: There are links to non-Microsoft websites. The pages appear to be providing accurate, safe information. Watch out for ads on the sites that may advertise products frequently classified as a PUP (Potentially Unwanted Products). Thoroughly research any product advertised on the sites before you decide to download and install it.

    Was this answer helpful?

    0 comments No comments