Hello,

I tried to poke around a bit with "Shell.Application". Because of the
possibility to include typelib informations with the reference tag, I
created a wsf-script with this content:

<?xml version="1.0" encoding="windows-1252" ?>
<package>
<job>
<reference object="Shell.Application"/>
<script language="vbscript">
<![CDATA[
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Example", 0, ssfPERSONAL)
]]>
</script>
</job>
</package>

But this didn't worked. The error was something like "reference from
{50a7e9b0-70ef-11d1-b75a-00a0c90564fe} could not be included". (The
message was in german so I have to translate). The problem was solved
with the line
<reference guid="{50a7e9b0-70ef-11d1-b75a-00a0c90564fe}"/>
instead of the orginal line. Why did the reference tag with the
object-attribute not work?

Regards,
Tobias

Re: Referencing Shell.Application in a wsf script by mr_unreliable

mr_unreliable
Wed Oct 12 10:55:23 CDT 2005

Servus Tobias,

I get the same result here, on a win98se system.

In (American) English, (fwiw) the error message reads:
"Cannot Add Reference".

I suspect the answer lies in either how the registry
entry is set up, or where the typelib is found.

But I can't really say for sure.

I think this is just one of those anomalies that come
up from time-to-time in the scripting world that never
get answered. One just has to accept them and move on.

mfg, jw

Tobias Bell wrote:
> Hello,
>
> I tried to poke around a bit with "Shell.Application". Because of the
> possibility to include typelib informations with the reference tag, I
> created a wsf-script with this content:
>
> <?xml version="1.0" encoding="windows-1252" ?>
> <package>
> <job>
> <reference object="Shell.Application"/>
> <script language="vbscript">
> <![CDATA[
> Set objShell = CreateObject("Shell.Application")
> Set objFolder = objShell.BrowseForFolder(0, "Example", 0, ssfPERSONAL)
> ]]>
> </script>
> </job>
> </package>
>
> But this didn't worked. The error was something like "reference from
> {50a7e9b0-70ef-11d1-b75a-00a0c90564fe} could not be included". (The
> message was in german so I have to translate). The problem was solved
> with the line
> <reference guid="{50a7e9b0-70ef-11d1-b75a-00a0c90564fe}"/>
> instead of the orginal line. Why did the reference tag with the
> object-attribute not work?
>
> Regards,
> Tobias