Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

February 01, 1999 12:00 AM

Why Use WSH?

Windows IT Pro
InstantDoc ID #4820
Rating: (0)

You typically have many options when creating scripts in the Win32 environment. You might be able to script a task using Visual Basic Script (VBScript) within Windows Scripting Host (WSH), VBScript within the context of a Web page, or Visual Basic for Applications (VBA) within one of the Microsoft Office applications (e.g., Word).

How do you decide which approach to take? In many respects, the choice is a matter of personal preference. However, I prefer to use WSH for several reasons:

Centralization. With WSH, you can keep all your general-purpose scripting efforts within one environment and, presumably, within one folder. Centralization minimizes confusion and makes the interface to all your scripts consistent. You simply go to the folder and double-click on the desired script rather than, say, opening a Word document to access a utility that cleans up temporary directories.

Versatility. With WSH, you can use tools written in scripting languages other than VBScript. If you find a JScript utility that does exactly what you want, you don't have to port the utility, as you would have to do if you were using, for example, VBA within Word documents.

Security. The 5.0 version of the scripting engines for VBScript and JScript let you encrypt scripts. Encryption keeps others from tampering with your code.

Functionality. A script that affects local files and directories won't work within the Internet Explorer (IE) or Netscape Navigator environment, because of the security schemes that these applications impose. WSH scripts that affect local files and directories will work in the IE and Navigator environment. In addition, WSH lets you incorporate Web digest functionality into other scripts, such as logon scripts.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.