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 


May 2008

Vista Command-Line Tools

Use these tools to mirror directories, manage ACLs, perform backups, and complete other important administrative functions
RSS
Subscribe to Windows IT Pro | See More Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Executive Summary:
Microsoft's Windows Vista operating system (OS) includes a host of command-line tools to help you administer your systems. Here are the commands you need to modify your boot configuration, manage access control lists (ACLs), perform backups and system assessments, and other useful functions.

The lion’s share of the attention to Windows Vista always seems to center around the new interface, which is understandable considering its exciting new look and feel. Unfortunately, part of the attention is because you now have to find new ways of doing old tasks. However, new features in Vista don’t end with the UI. Under the covers, Vista also sports command-line tools—many of them new—that make a powerful addition to your administrative toolbox. Here are my favorites.

10. Bcdedit—The days of editing the simple boot.ini file are gone. Vista’s new boot process saves its system boot configuration in the Boot Configuration Data (BCD) store. Like all bad ideas, the BCD store replaces a simple concept with a complex albeit more secure one. Bcdedit is your primary tool for editing the BCD store. Bcdedit supports a wide set of command-line options. For instance, to list the contents of the store you can run

bcdedit /enum

9. Choice—A handy batch-file command, choice lets you display a list of choices to users of a command-shell script. The choice command returns an index value in the ERRORLEVEL environment variable indicating the user’s selection. For example, the following command prompts users to enter Y, N, or C; the ERRORLEVEL variable returns 1, 2, or 3 respectively:

CHOICE /C YNC /M “Press Y, N, or C.”

8. Waitfor—The waitfor command is a useful scripting command that synchronizes processes running on multiple systems on the network. As its name suggests, waitfor can pause a script until the command processor receives a specified signal, and it can also send a signal to one or more systems on the network. The following command waits for the ScriptDone signal:

waitfor ScriptDone

7. Wbadmin—Although you might not have a clue based on its name, the new wbadmin command is Vista’s command-line backup tool. The following example shows how to use wbadmin to backup the C and D drives to the share named backup on myserver:

wbadmin start backup -backupTarget:\\myserver  backup include:c:,d:

6. Icacls—The Icacls command replaces the older cacls command. Icacls lets you list, update, and back up the access control lists (ACLs) for files and directories. The following example shows how you can save the ACLs for the C:\temp directory:

icacls c:\temp /save tempacl

5. Winsat—Winsat is the new Windows System Assessment tool. It runs automatically when you install Vista, but you can run it on demand for simple system benchmarking and system information. For instance, to list your system information, you could run winsat with the features parameter:

winsat features

4. Clip—The new clip command is a handy tool that copies the output of other command-line tools to the clipboard. The following example shows how to use clip to copy the contents of the file mytext.txt to the clipboard:

clip < mytext.txt.

3. Forfiles—The forfiles command is another useful batch-file tool. It executes a command over a set of files. Forfiles is much easier to use than the older and more obtuse for command. The following example shows how you could list all files more than 30 days old in the c:\temp directory:

forfiles /p c:\temp /s /d -30 /c “cmd /c echo @file

2. WinRS—The WinRS tool is essentially the Windows version of Linux’s Secure Shell (SSH). WinRS lets you open a secure command window to a remote host. All the contents of the remote shell are encrypted. The following example connects to the server named myserver and runs the dir command:

winrs -r:myserver dir

1. Robocopy—Without a doubt, the best commandline addition to Vista is robocopy. Although robocopy isn’t new to most of our readers (it’s been a staple in the Windows Resource Kit for years), Vista is the first release that includes robocopy as a part of the OS. Robocopy is a super-powerful command-line copy tool. The following example shows how to create a mirrored copy of the directory called shares and all of its subfolders.

robocopy “C:\Shares” “\\server2\ Shares Backup” /MIR /R:2 /NP

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
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

IE 8.0 and Chrome Could Enable Next-Gen Web Apps—Unless Your ISP's Bandwidth Cap Gets in the Way

Both browsers are being positioned as the core system application that will enable the next generation of web apps--however, ISP usage caps could throw a major monkey wrench at web-based application delivery. ...

Escape From Yesterworld

Kevin points you to the funniest SQL Server website ever! ...


Related Articles Q. How can I view the OSs listed in the boot configuration data store?

Castaway on Command-Prompt Island

How can I remotely run commands on a Windows Vista or Windows Server 2008 box?

Icacls: The New and Improved Cacls?

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

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs 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.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

IT Connections
Dive into the new Microsoft platforms and products you implement and support with the experts from Microsoft, TechNet Magazine, Windows ITPro and industry gurus. There are 70+ sessions and interactive panels with networking opportunities.

Attention User Group Leaders...
Announcing the eNews Generator—a FREE HTML e-newsletter builder for user group leaders. Build your HTML and text e-newsletters in minutes and add Windows IT Pro & SQL Server Mag articles alongside your own message!.

Master SharePoint with 3 eLearning Seminars
Learn how to build a better SharePoint infrastructure and enable powerful collaboration with MVPs Dan Holme and Michael Noel. Register today!

Get SQL Server 2008 at WinConnections
Don’t miss Microsoft Exchange and Windows Connections conferences, the premier events for Microsoft IT Professionals in Las Vegas, November 10-13. Every attendee will receive a copy of SQL Server 2008 Standard Edition with one CAL.



Interested in Email Encryption?
Read about the advantages of identity-based encryption in this free report.

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

Virtualization Congress Oct. 14-16 in London
Don't miss Virtualization Congress, the premiere EMEA conference dedicated to hardware, OS and application virtualization. Oct. 14-16.
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 Technical Resources 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