February 2004

Backing up Windows 2000 from the Command Line


RSS
Subscribe to Windows IT Pro | See More Backup and Recovery Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

I want to use the command line to back up data from a Windows 2000 system to a tape drive, as well as to restore the data from tape. How can I do so?

You can't use the command line to restore data from tape to a Win2K system, but both Windows XP and Win2K support several commands to perform backups. The following sample command runs a typical batch file, which you can use to back up the local system:

ntbackup backup C:  
  [systemstate] 
  /J "<job name>"
  /D "<backup description>"  
  /HC:ON /T "<tape name>"
  /M incremental /um

The optional systemstate parameter is important. This parameter instructs NTBackup to back up the registry, the COM+ Class registration database, boot files (including system files), system files that are under Windows File Protection (WFP) and typically don't appear in Windows Explorer, and specialized data such as that contained in Active Directory (AD), Sysvol, and the Certificate Services database. This option is a marked improvement over NTBackup's /R switch (in Windows NT 4.0), which backs up only the registry. The /HC switch refers to hardware compression; I suggest you set this switch to ON (hardware compression permits faster backups that require less tape space). The /M switch refers to backup type; choose from normal, differential, incremental, or daily. The syntax in the example lets you run the batch file on multiple computers. The /um switch refers to unmanaged backup and tells NTBackup to format or overwrite the first tape that it finds.

Aside from the options that the example shows, you can replace the /T "tape name" switch with the /G "GUID" switch, which tells NTBackup to use a globally unique identifier (GUID) rather than a tape name. You can also use the /A switch in place of the /um switch to instruct NTBackup to append the backup rather than overwrite an earlier backup. You can add the /V:yes switch to verify the backup when it's finished. If more than one tape drive is present on a system, you can use the tape: parameter to specify which drive to use; tape:0 represents the first drive, tape:1 represents the second drive, and so on.

Unfortunately, NTBackup has some limitations, the most serious of which is its inability to back up remote computers' system state data. (That task requires the purchase of third-party software from a vendor such as VERITAS Software.) You can, however, back up a specific drive on a remote computer. To do so, list the computer name and drive—for example

ntbackup backup \\<computer name>\d$

—in the command. (The user running this command will need administrative privileges.) Alternatively, you can map a network drive at the command prompt, for example

net use x: 
\\<computer name> \<sharename>

You can then use the /A switch to append the share backup to the tape, then type

net use x: /delete

to discontinue the retention of the share.

Listing 1 shows a batch file that you can use to back up a remote drive. When writing such a batch file, I prefer the command-line editor because it doesn't place any stray characters in the file. However, the DOS Copy con method still works in XP, and the F6 command still ends the file. Just be sure to use the .bat extension in the filename. For more information about the NTBackup command in Win2K, see the Microsoft article "How to Use Command Line Parameters With the 'Ntbackup' Command" (http://support.microsoft.com /?kbid=300439).

End of Article



Windows IT Pro Community
Blogs





Top Viewed ArticlesView all articles
CES 2009: Ballmer Announces Windows 7, Windows Live, Live Search Milestones

During his first-ever Consumer Electronics Show (CES) 2009 keynote address last night in Las Vegas, Microsoft CEO Steve Ballmer announced the pending public availability of a feature-complete Windows 7, the final version of Windows Live Essentials, and ...

10 Reasons to Deploy Windows Vista

The decision to upgrade your XP systems to Vista is simple when you consider features such as easier backup, a great desktop search, and vastly improved security options. ...

10 Reasons Not to Deploy Windows Vista

The decision to upgrade to Vista has to make business sense, but many companies find the costs in training and application compatibility problems outweigh any benefits Vista brings. ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


SQL Server Magazine Office & SharePoint Pro Windows Dev Pro ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing