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



JSI Tip 8097. Enclosing a set of commands in parenthesis () simplifies some batch files?

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


8097 » Enclosing a set of commands in parenthesis () simplifies some batch files? 01-Jun-04


Enclosing a set of commands in parenthesis () groups them together.

Example:

If your batch contains a set of commands like:
@echo First line of new file>"%TEMP%\FileName.tmp"
CD C:\FolderName
@echo Folder is %CD%>>"%TEMP%\FileName.tmp"
dir /b>>"%TEMP%\FileName.tmp"

Then, using parenthesis results in a simpler construct:

(
 @echo First line of new file
 cd C:\FolderName
 @echo Folder is %CD%
 dir /b
) >"%TEMP%\FileName.tmp"



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
2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

Microsoft, News Corp. Discuss Locking Out Google

Microsoft and Rupert Murdoch's News Corp. recently discussed an alliance that would counter Google's fledgling online news service. ...

Is Microsoft Just Like IBM?

Microsoft has defined the way we do business from a technology perspective for years. But with a younger generation that lives in the clouds, is Microsoft's recent progress in cloud computing too little, too late? ...


Scripting Whitepapers From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

Related Events 7 Ways To Get More From Your SharePoint Deployment Now

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


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
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement