executing vbscript block from msbuild

Hi
How to execute VBScript code block from MSBuild. Can VBScript be embedded within MSBuild file. Please show me how.
Thanks in advance.
[144 byte] By [connect2sandeep] at [2008-1-7]
# 1

Yes you can execute it from MSBuild, just use the Exec task. For this to work you will have to ensure that you have the Windows Scripting Host installed, and you will have to ensure that you have the "Open" verb correctly setup for files with extension vbs. Also note that vbs scripts are classified as dangerous by most sysadmins, don't be surprised if you have some sort of group policy restricting their use on your machine.

You can't really embed vbs within an MSBuild file, you would have to store it in a property and then call a custom task to do anything with it.

But why would you use vbscript when you have the power of compiled .Net code in the language of your choice to work with (if you write a custom task)?

sluggy at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 2
I used:
<Exec Command='$(ScriptPath)\BuildVBScript.vbs "$(param1)" "$(param2)"' />.
connect2sandeep at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 3

And did it work? Or was that the way you originally tried and it failed?

If it worked and my answer was correct then mark it as correct. Or if you are having problems still then be a bit more verbose, like tell us what error you got.

sluggy at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...
# 4

I bet it did work Smile That's how I use it all the time and it works for me...

Cheers, Eugene

P.S. And by the way, the reason to use VBScript - it is easy and fast way to access some COM objects

EugeneZakhareyev at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio MSBuild...

Visual Studio

Site Classified