Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Including Libraries in VBscript?

206 views
Skip to first unread message

Janak Sanariya

unread,
Aug 24, 2000, 3:00:00 AM8/24/00
to

I want to be able to write the following line in a VBscript file

Dim FileService As IADsFileShare

But currently whenever I run the script it give me a error because Windows
Scripting Host doesn't know what IADsFileShare is. I assume that this
information is included in a Library somewhere. Is there anyway to include
it(Like in C)?

-Janak

P.S. I can include file when I develop in VBA because in excel there is a
option which gives you a list of libraries and you can check the ones that
you need.

Respond_ Within@newsgroup.com Walter Zackery

unread,
Aug 24, 2000, 3:00:00 AM8/24/00
to

Put an apostraphe in front of the As keyword and your statement will
work just fine. <g> Seriously, you can't early bind in VBscript. The
As keyword is out.

"Janak Sanariya" <jan...@targetdataman.com> wrote in message
news:uvqBWXeDAHA.253@cppssbbsa05...
:
: I want to be able to write the following line in a VBscript file

:
:
:
:

Janak Sanariya

unread,
Aug 24, 2000, 3:00:00 AM8/24/00
to

So How would I get the following code to work? i.e. how would I create the
ADsSecurity object?
-J

Dim oSec as New ADsSecurity
Set oSD = oSec.GetSecurityDescriptor("FILE://c:\temp")

oDAcl.AclRevision = 2

' set Domain Admins group to full access
Set oAce = New AccessControlEntry

"Walter Zackery" <Please_ Respond_ Wit...@Newsgroup.com> wrote in message
news:8o3k0g$344g$1...@newssvr05-en0.news.prodigy.com...

Chad Myers

unread,
Aug 24, 2000, 3:00:00 AM8/24/00
to

You can't early bind in VBScript period.

All variables are Variants, period.

You can do this:
--------------------------
Dim oSec, oSD, oACE

Set oSec = WScript.CreateObject("????.ADsSecurity")

Set oSD = oSec.GetSecurityDescriptor(FILE://c:\temp)

Set oAce = WScript.CreateObject("ActiveDS.AccessControlEntry")

--------------------------

For the ADsSecurity object, you uneed to know the whole ProgID
and I don't have ADS Security objects loaded, so I don't know what
it is exactly.

-Chad


"Janak Sanariya" <jan...@targetdataman.com> wrote in message

news:#36KbYfDAHA.195@cppssbbsa05...

Ian Hayes

unread,
Aug 24, 2000, 1:09:35 PM8/24/00
to

"Janak Sanariya" <jan...@targetdataman.com> wrote in message
news:uvqBWXeDAHA.253@cppssbbsa05...
> I want to be able to write the following line in a VBscript file
>
> Dim FileService As IADsFileShare
>
> But currently whenever I run the script it give me a error because Windows
> Scripting Host doesn't know what IADsFileShare is. I assume that this
> information is included in a Library somewhere. Is there anyway to include
> it(Like in C)?

You can't declare variable types in VBSCript. They're all variants initally.
Just "Dim FileService" will do.


Ian Hayes

unread,
Aug 24, 2000, 3:01:26 PM8/24/00
to

"Janak Sanariya" <jan...@targetdataman.com> wrote in message
news:#36KbYfDAHA.195@cppssbbsa05...
> So How would I get the following code to work? i.e. how would I create the
> ADsSecurity object?
> -J
>
> Dim oSec as New ADsSecurity
> Set oSD = oSec.GetSecurityDescriptor("FILE://c:\temp")
>
> oDAcl.AclRevision = 2
>
> ' set Domain Admins group to full access
> Set oAce = New AccessControlEntry

Here's a good place to start... I tried running the code snippet, and it
appeared to work. This will get you the security descriptor of a file...
http://msdn.microsoft.com/library/psdk/wmisdk/securityprov_9dyr.htm

And this will set the descriptor for a file:
http://msdn.microsoft.com/library/psdk/wmisdk/securityprov_5p83.htm

Both are Visual Basic snippets, but they work in VBScript rather well. Just
might take a little tweaking.


0 new messages