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

Using NDAP controls with WSH

3 views
Skip to first unread message

Ken McKelvey

unread,
Aug 29, 2003, 8:50:38 AM8/29/03
to
I am trying to use the NDAP controls with Windows Script Host but am
not getting very far as all the examples seem to be in VB. In WSH I
seem to be having trouble instantiating the objects. Does anyone have
any examples in WSH?

At the moment I am simply trying to simulate NCopy.exe.
From the examples I think the VB code is:

Dim ent As NWVolAdmin.NWEntry
Set ent = NWVolAdmin.FindEntry("\\Server\Vol\file1")
ent.copy("\\Server\Vol\file2")

Presumably in WSH I need to use WScript.CreateObject first but I
cannot find any parameter that works.

Any ideas will be gratefully received.

Thanks,
Ken McKelvey

Ken McKelvey

unread,
Sep 1, 2003, 9:51:10 AM9/1/03
to
If anyone is interested, I managed to get it to work by:

In JScript:
var NWVol = WScript.CreateObject("NWVolAdmLib.NWVolAdmCtrl.1");
NWVol.FullName = "\\\\server\\vol";
var ent = NWVol.FindEntry("\\\\server\\vol\\file1");
ent.copy("\\\\server\\vol\\file2");

In VBScript:
set NWVol = WScript.CreateObject("NWVolAdmLib.NWVolAdmCtrl.1")
NWVol.FullName = "\\server\vol"
set ent = NWVol.FindEntry("\\server\vol\file1")
ent.copy "\\server\vol\file2"


ken.mc...@knightfrank.com (Ken McKelvey) wrote in message news:<707d6a80.03082...@posting.google.com>...

0 new messages