IntelliSense in Visual Studio .NET for Windows Scripting Files

Some time ago I spent some time on Windows Scripting Files (*.wsf files) and wrote an article on that. It’s in Dutch, but if you are interested, you can read it here.

Anyway, what I did not include as part of the article is this XML Schema that will give you IntelliSense when you create a Windows Scripting File. Maybe you have never discovered this item type in Visual Studio .NET, but it’s really there. Check under Add New Item in the File menu of VS.NET: it is called Windows Script Host.

To make use of the IntelliSense, simply copy this file into the folder “C:Program FilesMicrosoft Visual Studio .NET 2003Common7Packagesschemasxml”.
Next, whenever you create a Windows Script File and add the correct namespace, you will get the visual support for wsf files. The top of the wsf file should look like this:

<package xmlns=”Windows Script Host”>
 <job>
   <SCRIPT language=”JScript”>
     WScript.Echo(“JScript”);
   </SCRIPT>
 </job>
</package>

Make sure that the namespace of your wsf file matches the one in bold in the XML fragment. VS.NET will search the aforementioned folder for XML Schema files and check the targetNamespace specified for a exact match. You might even want to change the standard wsf script file called wscript.wsf located in the folder “C:Program FilesMicrosoft Visual Studio .NET 2003Common7IDENewScriptItems”

I’m pretty sure the XML Schema doesn’t cover all exotic combinations 100% correctly, but it does give you a good idea on what you can use in what place. Have fun with it.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s