I allready tried that and couldn't do it directly because to use an API in VB, you need to declare it with a statement that looks like this :
Code:
Public Declare Function AddPrinterConnection Lib "winspool.drv" Alias "AddPrinterConnectionA" (ByVal pName As String) As Long
Vbscript doesn't allow this kind of external declaration. The only way, to my mind, to achieve what you want is to create an ActiveX (with VB for exemple) that will encapsulate your API call and then instanciate this activeX in VBScript using CreateObject method.
Water is not bad as long as it stays out human body ;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.