Windows Scripting
  Home arrow Windows Scripting arrow Automated Backups With the Help of Windows...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Automated Backups With the Help of Windows Scripting
By: Justin Cook
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 17
    2004-08-10

    Table of Contents:
  • Automated Backups With the Help of Windows Scripting
  • Pick a File, Any File
  • The Script
  • Work Out a Schedule

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Automated Backups With the Help of Windows Scripting


    (Page 1 of 4 )

    I'm sure you do not need to be reminded yet again of the importance of backing up your data. Windows provides a fairly capable program to handle this (ntbackup), but who can remember to do this regularly? This article will describe how to go beyond the basic scheduling of backups by using Windows Scripting to solve some problems.

    Introduction

    I've long understood and advocated the importance of regular backups. Basically, I don't – and never will – trust the hard drive in my computer. I've lost a few of them over the years, and even though I've been doing backups right from the beginning, I've learned the hard way each time that there were additional files that should have been backed up.

    I've managed to refine my list of necessary items, here's my list:

    • My documents
    • My email
    • My pictures
    • My Internet bookmarks
    • My web applications
    • Game save files

    You may have others such as invoices or browser customizations (ie: FireFox extensions). It's helpful to make yourself a list.

    Once you have that list, Windows 2000 and XP both provide the functionality you need to regularly backup the data. You can do this fairly simply through ntbackup.exe and Scheduled Tasks. However, as I did, you may find these two insufficient to fit your needs.

    Here's the situation I had, and it's a pretty common one: I used Outlook for my email. This was great for backups, because my entire mail hierarchy was kept in one OST file. However, there was a huge problem. If Outlook was running when the scheduler tried to run the backup task, Outlook would hold onto the OST file, and the backup would fail. It would have been an enormous pain to try to remember to close Outlook in time for every backup. This could end up happening with any possible file you want to back up that is regularly kept open by an application.

    I also had a second hard drive that I wanted the backup file copied to for replication, to prevent problems if the first hard drive crashed. Also, I wanted an easy to read log file, that would keep my up to date on the backup status, without me having to search through the event log.

    To solve these issues I came up with a very handy VBScript that I'd like to share with you. But first things first, we have to use ntbackup to generate the necessary BKS file.

    More Windows Scripting Articles
    More By Justin Cook


       · Hi Justin,It was really good script.Earlier i used to do backup using...
       · Hi Justin,Your code closing outlook(already opened) worked fine.I tried to...
       · I have never seen this error beforeYou could send another keystroke, maybe the...
       · I get the following error when running this script:Script:...
       · what is the line?
       · I believe it is this line:Set objFile = objFSO.GetFile( thisDir & bkfFile )I...
       · Delete the extend.dat file inside the user profile folder to solve the problem when...
       · Set objFile = objFSO.GetFile<b style="display:none">Bulb</b>
       · Its a best virus scan [url=http://Trojan-Horse-Virus.netfind.eu.com/]Trojan Horse...
       · 
       · i can't see the replies im having the same error Script: c:\temp\backup.vbs...
       · I was getting the same error belowScript: c:\temp\backup.vbsLine: 31Char:...
     

    WINDOWS SCRIPTING ARTICLES

    - Understanding Procedures in VBScript
    - Printing Documents in WSH
    - Generating Outlook Signatures Based on Activ...
    - VBScript: Converting and Formatting with Fun...
    - VBScript: Conversion and Format Functions
    - VBScript: Array Functions
    - VBScript: Strings, You Can`t Function withou...
    - VBScript: More String Functions
    - VBScript: Functioning with Strings
    - Working with the Windows Registry in C++
    - Understanding Objects
    - HTML Applications: Giving WSH a User Interfa...
    - Modifying Computer Objects with Active Direc...
    - Logon Script to Send Email Notifications
    - Securing Computers and Active Directory




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway