Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Posted by Admin Friday, January 06, 2012 12:00:00 AM Categories: _Tous les articles Windows 7 Windows Vista
Rate this Content 0 Votes

For command line use, read this article :
Windows Backup (sdclt.exe) VISTA/SEVEN command line parametters

INTRODUCTION
This is a little program that allow you to use Windows Backup tool of Windows VISTA or Windows SEVEN in command line, sample you can backup your system and datas at Windows shutdown or user logoff

INSTALLATION
Before all configure the "Windows Backup Tool (sdclt)"


 
1. Download and extract the files content in zip where you want.
2. Import content of registry keys stored in file "ConfigureBackupClosingSession.reg".
3. Open "Computer Policies" MMC console and go to "User Configuration => Windows Parameters => Scripts => Logoff Scripts.
4. Add new logoff script, for script application use "C:\Windows\System32\cscript.exe" and for parameters use "[your path]\StartWindowsVISTA-SEVEN-BackupTool.vbs"

4. Because Windows close it wait maximum 60 seconds before kill all applications, you must add a registry key or change GPO to force Windows to never close applications a shut down and wait indefinitely
4.1 Edit and change registry key to set value to "0".

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"MaxGPOScriptWait"=dword:00000000

 
5. Test application.


 

This is the content or registry file that i use

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
"HideLogoffScripts"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"HideShutdownScripts"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"MaxGPOScriptWait"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown\0\0]
"Script"="D:\\DATA\\SCRIPTS\\BACKUP_DATAS.CMD"
"Parameters"=""
"IsPowershell"=dword:00000000
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State\Machine\Scripts\Shutdown\0\0]
"Script"="D:\\DATA\\SCRIPTS\\BACKUP_DATAS.CMD"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

 

WBADMIN : Utility will start an image backup of your system, system and boot volumes while it saves it to the d: drive.

http://technet.microsoft.com/en-us/library/cc742083(WS.10).aspx

Sample :
wbadmin START BACKUP -backuptarget:d: -include:c: -allCritical -quiet

Create Backups of the System State Using a Command Line
http://technet.microsoft.com/en-us/library/cc753201.aspx

 
DOWNLOAD

StartWindowsVISTA-SEVEN-BackupTool.zip (69ko)

StartWindowsVISTA-SEVEN-BackupTool (69ko) SPECIAL VERSION with (/DELETECATALOGANDKICKOFFNEW) instead of (/KICKOFFNEW)

 
VERSION
First version 1.1.0.0
 

Simple-Tech.info

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Sunday, May 15, 2011 9:14:58 AM Cereal

Hello Jim,
Yes because Windows close it wait maximum 60 seconds before kill all applications, you must add a registry key or change GPO to force Windows to never close applications a shut down and wait indefinitely.
I have modified my article to add this information,

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Saturday, May 14, 2011 5:08:13 AM Jim Hughes

I managed to get to it remotely. Didn't work. Old backup files were retained. Also, I can run it out of a standalone .bat file where your script is runas Administrator but when I make the bat file a logoff script it seems to get terminated by the shutdown process. Jim

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Saturday, May 14, 2011 2:17:11 AM Jim H.

I will try in a couple weeks. I am away from the office for a while. Thanks. I will get back to you.

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Sunday, May 08, 2011 8:45:26 AM Cereal

Hello Jim,
You can download the version with parameter /DELETECATALOGANDKICKOFFNEW on this page or in downloads section.
If you have any problems don't hesitate to contact me.
Best regards.
Cereal

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Wednesday, May 04, 2011 1:49:42 AM Jim Hughes

Will new version allow exe to run by default if neither yes or no is clicked?

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Tuesday, May 03, 2011 12:30:33 PM Cereal
Hello Ok i compile a new version for you this week with the new parameter Best regards

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Tuesday, May 03, 2011 9:18:22 AM Jim Hughes

Definitely need the runas administrator even tho the user has admin rights and UAC is off. Exe does not start if neither yes or no is clicked. The default should be yes if nothing is clicked in case of unattended operation. Also, I would like a version of the exe where the command line parameter is /DELETECATALOGANDKICKOFFNEW instead of /KICKOFFNEW. Thanks.

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Saturday, April 30, 2011 7:07:59 AM Cereal

Could you run the exe with administrator privilege or déactivate the UAC. What's the result ?

re: Run Windows backup (sdclt) in command line to backup system at logoff or computer shutdown

Wednesday, April 27, 2011 5:57:09 AM Jim H.

I get an access denied message when running the script or the exe on it's own. In one case is says it cannot cancel the automatic scheduling.

Site Map | Printable View | © 2008 - 2012 Simple-Tech.info | Powered by mojoPortal | HTML 5 | CSS | Design by mitchinson