Prev | Current Page 415 | Next

John Paul Mueller

"Administering Windows Server 2008 Server Core"

onscript.com/training-videos/titles/windowsscript-
files-unmasked.asp
. You can see some WSF examples at
http://msdn.microsoft
.com/archive/en-us/wsh/htm/wsAdvantagesOfWs.asp
.
The best way to edit a WSF file is to use an editor designed for the purpose. You may find the
combination of XML and scripting code a little disorienting at first and a good editor can help you
overcome that problem. The ???Editing Script Files with Script Editor 2.1??? section of Chapter 7 tells
you about one such editor, but you??™ll likely find many other editors on the market.
A WSF file begins with a

element. The

element can contain an
id
attribute that you
can use later to execute a specific job within a file. For example, if the source code file contains the
following

element:

and the name of the file is
MyScript.WSF
, you can execute it by typing
CScript //Job:MyJob
MyScript.WSF
and pressing Enter. Of course, as with any good XML, you must include the ending

element.
EXECUTING SCRIPTS
163
Having the

element isn??™t enough to create a script, however. You must also include the