Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


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



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
What You Need to Know About Microsoft's x64 Server Product Plans

What do Longhorn Server, Windows Compute Cluster Server, and Windows Vista have in common? The x64 platform. ...

Anti-Virus Vendors Prepare for War with Microsoft ... Again

When Microsoft announced its Windows Live OneCare security and PC health product over five years (as MSN OneCare), Symantec, McAfee, and the other consumer-oriented security vendors reacted with stunning vigor. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


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

Related Events WinConnections and Microsoft® Exchange Connections

Cutting Costs with Client Management

Learn How to Solve your Toughest Storage Challenges... In Just 6 Minutes or Less

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 Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format

Test Drive IT Solutions and Get Free Music Downloads
Solve your toughest IT problems with these free downloads and receive 5 free music downloads!


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home asp.netPRO Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement | Reprints and Licensing