October 14, 2008

Whip Script Data Into Shape

Save your data into a readable and reusable file
RSS
View this exclusive article with VIP access -- click here to join |
See More ActiveX Data Objects (ADO) Articles Here | Reprints | Or sign up for our VIP Monthly Pass!

The available tools for writing structured data to files and reading it back are too complex for everyday use in Windows scripts. A set of simple wrapper functions can fix that problem, allowing scripters to save dictionary data to a file and read it back without laborious coding.


Tools for saving data to files weren't developed with administrators or scripters in mind. This isn't typically a problem for most support staff, but when you need to save script data—that is, complex information used within a script—to a file and read it back elsewhere, having a simple tool to handle the process is crucial. I'll discuss some of the reasons why existing tools for persisting data to a file aren't as useful for scripters as they are for programmers, then I’ll demonstrate a couple of Windows Script Host (WSH) helper functions that let you quickly read and write simple key-value data pairs to an XML file and read them back—without having to understand the intricacies of XML. . . .

Learning Path For more information about WSH scripting:
"WSH, Part 1: File Types"

"WSH, Part 2: .wsf Files"

"WSH, Part 3: Windows Script Components"


Top Viewed ArticlesView all articles
No Jobs, No Excitement at Apple's Last Macworld Keynote

Apple CEO Steve Jobs made the right move in skipping out on his company's last appearance at Macworld: In a Tuesday keynote address at the conference, Apple had no interesting new products to sell, opting instead to spend mind-numbing amounts of time on ...

Where is Microsoft NetMeeting in Windows XP?

...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Related Articles WSH, Part 3: Windows Script Components

WSH, Part 2: .wsf Files

WSH, Part 1: File Types

Good Business Reasons for Using XML

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.


SQL Server Magazine Office & SharePoint Pro Windows Dev Pro ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing