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


July 09, 2003

Universal Command-Line Wrapper Tool for WSH

Simplify access to command-line output
RSS
View this exclusive article with VIP access -- click here to join |
See More Windows NT 4.0 Articles Here | Reprints | Or sign up for our VIP Monthly Pass!

Windows Script Host (WSH) has made its mark by leveraging outside components. Noteworthy WSH scripts often use external tools, such as Windows Management Instrumentation (WMI), Active Directory Service Interfaces (ADSI), and other COM-enabled libraries and applications. One particularly large and useful family of specialty tools is the traditional command-line tools. Command-line tools are ready-made for administrators and are often useful when tools such as WMI aren't available.

However, leveraging command-line tools in WSH scripts is difficult. Although WSH's WshShell object lets you access command-line tools through its Run method, using this method has two significant problems. The first problem is that many of the command-line tools have console-dependent behavior and can perform erratically if they execute in the wrong command processor. The second problem is more significant: The Run method doesn't provide a way to capture output. Although the new WshShell Exec method in WSH 5.6 returns command-line data, this method has limitations. It's complex to use because you must monitor streams. If you use WScript, the Exec method requires a visible console window, and a window pops up every time the method executes a command. Another limitation is that not everyone has WSH 5.6 installed. . . .


Already a VIP member?
Please log on to view the full article

Why become a VIP member?

VIP-only online access
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine

Subscribe Now
Top Viewed ArticlesView all articles
Kon-Boot Lets You Bypass Logon for Windows and Linux

Kon-Boot looks like a very interesting tool since it can get you into a system without having to logon first. ...

Google to Take On Windows with New OS

It's official: Google will compete head-to-head with Microsoft's dominant Windows OS with a new system called Google Chrome OS. Based on the Google Chrome browser and not its previous OS effort, the smart phone-based Android system, Google Chrome OS will ...

Q. How can I continually check a performance counter from Windows PowerShell?

...


Related Articles How to Multi-Thread VBScript Scripts

Related Events WinConnections and Microsoft® Exchange Connections

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!


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 | Reprints and Licensing