• Affiliate Marketing
 • Affiliate Marketing - Basics
 • Affiliate Marketing - Development
 • Affiliate Marketing - Setting Up
 • Archive catalogue
 • Autoresponders
 • Banner Advertising
 • Business Development
 • Checklists
 • Competitors
 • Copy Writing
 • Copy Writing - ad copy
 • Copy Writing - email copy
 • Copy Writing - sales copy
 • Customer Service
 • Database Marketing
 • Direct Mail
 • Domain Names
 • E-books
 • E-commerce
 • E-mail Marketing
 • E-zines
 • E-zines: Advertising
 • E-zines: Promotion
 • E-zines: Subscribers
 • E-zines: Writing
 • Entrepreneurship
 • Free Services
 • Home Based Business
 • Home Based Business - Finance
 • Home Based Business - Getting Started
 • Home Based Business - is it for YOU?
 • Home Based Business - Marketing
 • Internet Tips
 • Market Research
 • Marketing
 • Marketing Strategy
 • Net Business Start ups
 • Networking(MLM)
 • Newsletters/Newsgroups
 • Online Payments
 • Online Promotion
 • PC KNOW HOW
 • Personal Development For Marketeers
 • PR/Publicity and Media
 • Sales Tips
 • Search Engines
 • Search Engines - Keywords
 • Search engines - Optimisation
 • Selling Techniques
 • Surveys and Statistics
 • Telesales
 • Top 10 Tips
 • Traffic and Tracking
 • Viral Marketing
 • Website Design and Development
 • ZeLatest

Use your Computer as a Production Machine (4):

Category: PC KNOW HOW Date: 2002-06-27
BATCH-PROGRAM FOR BACKUP

Now that you organized your harddisk (see part 1) and you have chosen your backup strategy (see part 2), everythings ready for coding a batch-program for backup.

To call it "batch PROGRAM" is slightly misleading. It is no "programming" in the sense of "hard thinking" with a "compiler" and a "linker" - as they are quite normal when programming in C/C++ or any other Higher Programming Language. If anything, you could rather relate it to BASIC-programming. In the first place, there is no compiler or linker in BASIC. The code is only geared to a set of syntactical rules. At runtime it is submitted to a BASIC-interpreter.

The same is true for BATCH code. There is no compiler, linker, etc. In plain language, a batch code is simply "executed" (just like any executable application that was compiled and linked). Looking at it closer, the batch code is fed into an "interpreter". But for batch code, that interpreter is part of the operating system. You will never see it in a directory listing. All you have to do is adhering to a small number of syntactical rules.

The foremost rule is to code processing steps just as you would type them in the command line. The only difference being, on the command line you can have only one processing step at a time (disregarding some tricks that are not needed here). In a batch program, however, you can have any number of processing steps.

Thats very comfortable, if you have a somewhat complicated processing comprising many processing steps. To type them again and again in the command line would be fairly monotonous and after a few minutes even quite error-prone. Better you prepare a batch program to do it. Then you simply type its name ONCE in the command line. From now on you can watch the computer doing all that complicated processing, without you moving a finger.

Were going to use that to tell the computer to copy all the files you selected in the first step. Moreover, you can add a few lines for being prompted: "Want to backup ... to ... ?". You can have different ways of copying. And you can provide a "shortcut" to your batch program in the AUTOSTART directory. Thus backup will be done whenever you boot your computer. It will not even require you to think of it.

The simplest way to copy a directory and all its subdirectories to any destination is the following:

XCOPY source destination \ /s

source is your source directory (e.g. "C:\Own") Now you see why you should have organized your harddisk as outlined in part 1. By doing that, all the files to be backed up can be accessed by just one code line in your batch program.

destination is the name of your backup medium. (For examples see the introduction to this series, "Basics"). For your daily-backup this could be any other partition of your harddisk (e.g. "D:\Backup"). For your weekly-backup this could be the name of a partition on a laptop that is connected to your computer by a simple peer-to-peer network. In this case its name would be something like "\\Default\c:\Backup" if "Default" is the name of the laptop in your operating system. (See Start menu - Control Panel -Network. As well, you could look into your systems Explorer: Network - Total Network - [expand it]. Beneath you see the name of the computer from which the backup will be copied, and the name of the laptop in the network.) Dont forget the closing backslash. It is needed by XCOPY to know that the last part of destination is a directory, not a file. If this directory does not yet exist, it will be created on the backup medium.

/s is an important option here. Its telling XCOPY to copy not only the source directory but all its subdirectories.

If you have many files to backup, your computers screen would be swamped now. For each file copied the respective code line would be displayed. You can suppress that easily, though. Just add to the code line whose outputs you want to suppress: "> NULL". (Note that the greater-symbol > is part of the code here!) So, the complete code line would be:

XCOPY source destination\ /s > NULL

For your daily backup you might want to have a more economical backup than copying the entire source partition. You should have chosen the types of files to be backed up. If you want to have all the files of a type COMPRESSED before copying to the destination partition, the corresponding code line would be:

Wzzip -r -p destination\txt.zip *.txt > NULL

For files of any other type (say, xyz) you would have to code another code line:

Wzzip -r -p destination\xyz.zip *.xyz > NULL

-r and -p are options specific to Winzip, to search for matching files also in subdirectories and to memorize the path to each file archived.

You can download a free Winzip compression software from http://www.winzip.com/download.htm

For using Winzip in a batch program you need an Add-on, the "Winzip command line support". You can download it for free from http://www.winzip.com/wzcline.htm

There are many little tricks by which you can add comfortability to your batch program. To give you a simple example, lets assume you provided a shortcut to it in your AUTOSTART directory. Now your backup would be activated each time you are booting your system. Not only in the morning when you switch on your computer (programmer jargon: "cold booting"), but also on "warm booting" as it will be needed several times a day. Consequently, the first thing after starting the batch program should be a prompt whether to do a backup or not. In batch this could be implemented simply by two code lines:

REM Do backup (source) to (destination) ?
PAUSE
(source) is the name of the partition you want to backup.
(destination ) is the name of the destination partition on the backup medium

Now the batch program would first display the text "Do backup (source) to (destination)?" Then it would stop, waiting for you to press Ctrl+C or any other key. If you press Ctrl+C (= holding down the "Ctrl" key and concurrently pressing the "C" key), the backup is aborted. Pressing any other key would mean to continue.

About the Author

Article by Gunter Gerdenitsch, owner of 1st Components Design, Universal Software Components for Computer Applications without Programming 1st-components.com, 1CD offers a product line called "DLG" for building applications without programming.

;to contact see details below.


gunter@1st-components.com
http://www.1st-components.com
Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация

Copyright © 2005-2006 Powered by Custom PHP Programming

 • Affiliate Marketing
 • Affiliate Marketing - Basics
 • Affiliate Marketing - Development
 • Affiliate Marketing - Setting Up
 • Archive catalogue
 • Autoresponders
 • Banner Advertising
 • Business Development
 • Checklists
 • Competitors
 • Copy Writing
 • Copy Writing - ad copy
 • Copy Writing - email copy
 • Copy Writing - sales copy
 • Customer Service
 • Database Marketing
 • Direct Mail
 • Domain Names
 • E-books
 • E-commerce
 • E-mail Marketing
 • E-zines
 • E-zines: Advertising
 • E-zines: Promotion
 • E-zines: Subscribers
 • E-zines: Writing
 • Entrepreneurship
 • Free Services
 • Home Based Business
 • Home Based Business - Finance
 • Home Based Business - Getting Started
 • Home Based Business - is it for YOU?
 • Home Based Business - Marketing
 • Internet Tips
 • Market Research
 • Marketing
 • Marketing Strategy
 • Net Business Start ups
 • Networking(MLM)
 • Newsletters/Newsgroups
 • Online Payments
 • Online Promotion
 • PC KNOW HOW
 • Personal Development For Marketeers
 • PR/Publicity and Media
 • Sales Tips
 • Search Engines
 • Search Engines - Keywords
 • Search engines - Optimisation
 • Selling Techniques
 • Surveys and Statistics
 • Telesales
 • Top 10 Tips
 • Traffic and Tracking
 • Viral Marketing
 • Website Design and Development
 • ZeLatest