Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  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 log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Microsoft Kills OneCare, Will Launch Free Security Solution

Microsoft on Tuesday announced that it would retire its $50-a-year security subscription product, Windows Live OneCare, and replace it with a free solution codenamed "Morro." Unlike OneCare, however, Morro will focus only on core anti-malware features and ...

The website is down because someone removed the X-Box

What happens when a manager mistakes a server for a games console. ...

Xbox 360 Overhaul Arrives with New UI, Avatars

Xbox 360 owners who logon to the system's Xbox Live system this morning will receive the most significant functional change yet to the console's user interface, or dashboard. Dubbed the New Xbox Experience, this new front-end features a completely new ...


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

Related Events 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.


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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing