Torgeir
Mon Oct 11 07:23:14 CDT 2004
Viga wrote:
> hi,
> Is it a way to call Windows APIs from VB Script file?
>
> Thanks
Hi
You can use an API wrapper, e.g. DynaWrap, from an earlier thread:
<quote>
From: jim_w (jwarrington*noSteekin*@*Spam*worldnet.att.net)
Subject: Re: API Calls from VBScript
Newsgroups: microsoft.public.scripting.vbscript
Date: 2001-01-16 10:54:05 PST
hi Renu,
You can call an api using DynaWrap, which is available from Clarence's or
Guenter's websites, although you may prefer Guenter's as he provides some doc to
go along with the code.
Clarence:
http://cwashington.netreach.net/main/tools/default.asp?topic=a-m
(then look for: DynaWrap.dll)
Guenter:
http://www.borncity.com/WSHBazaar/WSHBazaar.htm
(click on DynaCall page)
Note: If you plan on doing something extremely complicated or grandiose, then it
may be advisable to write your own COM object (ocx) which is "scriptable", to
"wrap" the api calls. The api declarations are easier to deal with when coding
in visual basic, and your script would look a lot less messy. (And, your
scripting friends would make a lot fewer diaparaging remarks about you). If you
have any interest in writing an ocx "wrapper" for your api calls, then you might
want to consider using vb5cce (a.k.a. Microsoft's gift to scripters) at:
http://msdn.microsoft.com/downloads/tools/visualbasic/vbcce.asp
Better get it before Microsoft changes it's mind, and tries to sell you vb.net
instead.
cheers, jw
</quote>
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx