Using Windows Scripts To Backup Files To External Hard Disk

Posted: Feb 19, 2010 |Comments: 0 | Views: 369 |

One of the more routine processes that can be performed with a Windows script is backing up files and folders. Often times you just want to copy files onto a backup USB type jump drive or other external hard drive that can be removed and stored safely in case of emergency and can also be easily moved from system to system.



The first step in building this script is you need to assess what exactly needs to be backed up. Is it just a hand full of files or are there complete directory structures and folders that need to be saved in case of a disaster. If you are just copying files straight across to a backup drive you can use the copy command and some wild cards in place of file names along the lines of "copy *.*" which will copy all files from a source to a destination regardless of name or file extension.



There are additional switches you want to be aware of for use with the copy command. The V switch will verify all of the files copied with the original and can come in handy if you are copying files to a floppy disk using a questionable or flaky disk drive. If you want to create a script that can run in the background without user intervention then you will make use of the Y switch. The Y switch suppresses prompting when the copy command overwrites files in to the destination. For example if every day you backed up the same set of files to a backup drive you would want the copy to overwrite the files instead of prompting you to confirm each one.




Now if you want to keep a directory structure along with folders and sub-folders intact or copy them over verbatim, you will need to use the xcopy command. Xcopy is like the copy command only on steroids with many more features including the ability to copy whole folders and sub folders containing files. Executing this command would look like "xcopy source destination" with the E switch which will copy all files and folders. Just like copy the xcopy command supports the Y switch to suppress overwrite prompts.



When it comes to the xcopy command I could cover many more features which can be quite powerful when building Windows backup scripts for your workstations and servers. With this cool command you have the ability to copy over ownership and security information, file system attributes, and so much more. With either the xcopy or copy commands you also have the ability to pipe the detailed job log information into an output file using the > character followed by the file name. You can then go back and review the detailed log files to make sure all of the backups are running smoothly.



Once you have a backup script created you can take it a bit further by looking at ways we can schedule it to run automatically and then freeing up your time to do more important things. Automating a script like this can be easily accomplished using the task scheduler that comes pre-installed with Windows. You simply specify what days and time you want the script to run and your off to the races.

Questions and Answers

Ask
200 Characters left
Rate this Article
  • 1
  • 2
  • 3
  • 4
  • 5
  • 0 vote(s)
    Feedback
    Print
    Re-Publish
    Source:  http://www.articlesbase.com/computers-articles/using-windows-scripts-to-backup-files-to-external-hard-disk-1879379.html

    Article Tags:

    windows script host

    ,

    windows script

    ,

    xp script

    Windows Hosting is more attention from Internet users especially among a new generation of artists. Windows hosting services, has quickly gained popularity and monopolizing more than 50% of the web hosting industry today

    By: bhardwajweb01l Internet> Web Hostingl Jan 12, 2012
    Joseph Nyamache

    There are many factors to consider before choosing between windows web hosting compared to other hosting platforms, this article will consider some of the factors you should know about windows webhosting.

    By: Joseph Nyamachel Internet> Web Hostingl Sep 09, 2008

    The websites are hosted at 2000, internet information server which is known as the IIS and at the Microsoft Windows NT are included in the windows hosting. The Microsoft Windows server edition such as XP or windows 2003 web hosting is having the NT server installed on it.

    By: jasongonce001l Internet> Web Hostingl May 28, 2012

    Replication is the process of creating copies of your data, specifically while migrating to another system or for creating backup. In Microsoft Windows operating system, it can be done using FRS (File Replication Service).

    By: Robin Watsonl Computers> Data Recoveryl Dec 03, 2009

    Windows XP Pro a robust OS which has several features left unexplored. This article tries to encompass the great features of this OS.

    By: Saurav Batral Technologyl Oct 29, 2007 lViews: 797
    Aakash Shah

    Web hosting allows an individual or a company to make its own website accessible to million others through internet. The web hosting server technologies are specific for the operating system the client desires to use as well on the content of his website.

    By: Aakash Shahl Internet> Web Hostingl Jul 05, 2009

    An in depth look at the new MMORPG from Blizzard Entertainment known as Diablo III, a long awaited release for Diablo fans.

    By: swtorman90l Computersl Jun 01, 2012

    Most small businesses take advantage of computer technology, and it certainly can make things a lot easier for everyone within the business when you do so properly. Unfortunately, there are also a number of different problems that can occur as a result of the technology that you are using.

    By: Jesus Mattsonl Computersl May 31, 2012

    Small business financial software plays a vital role in the operations of an organization especially the small enterprises. This is where you get the opportunity to keep the record of all the financial activities that are occurring in your organization.

    By: Chris Alexanderl Computersl May 29, 2012

    Wireless is one of the best ways in order to get internet to a laptop or a computer, but if you want to sell wireless items in the US or Canada, you need to be sure you pass the wireless testing and you get the FCC certification to prove it.

    By: Jack Bandyl Computersl May 29, 2012

    Find out all you didn't know about toner cartridges. Every year Canadians throw out 35 million printer cartridges with a 12 percent annual increase.

    By: Alex Harperl Computersl May 29, 2012

    When it comes to reporting tools for the AS/400, iSeries and IBM i platform there are many products to pick from. In fact a whole cottage industry has sprang up over the years with a myriad of different data tools for reviewing and extracting data from the OS/400 integrated DB2...

    By: John Andersenl Computersl Jul 19, 2011

    One of the more commonly asked questions I see in forums and by end users is how do you get your data from the AS400 down to the PC in a text file format or as an Excel based spreadsheet. And fortunately with modern tools and software this is a...

    By: John Andersenl Computersl May 09, 2010 lViews: 525

    Whenever I start working on an AS/400, iSeries or Power System box at a new company there are a few key areas I like to be sure of. These areas include ensuring basic system level security, job configuration and process management. Let's take a fast look at how you can...

    By: John Andersenl Computersl May 04, 2010

    One of the nice features of the AS/400 and iSeries platform is it's reliability and administrative requirements. But even in light of this as a system administrator you should also be looking and monitoring key data elements to create a baseline of performance metrics. This data can then be used...

    By: John Andersenl Computersl Apr 28, 2010 lViews: 177

    Having worked on and administered IBMs midrange AS/400, iSeries and System i platforms for the better part of ten years I have found that you can boil down the essential administrative functions to a few select commands available from one primary command. Let me explain. One of the major functions of...

    By: John Andersenl Computersl Apr 28, 2010 lViews: 259

    Discuss this Article

    Author Box
    Articles Categories
    All Categories
    Quantcast