
WNetAddConnection2 & /user:domain\username
Does anyone know how to specify the username and domain for the
WNetAddConnection2 call (or other API)?
For example:
NetR.dwScope = RESOURCE_GLOBALNET
NetR.dwType = RESOURCETYPE_DISK
NetR.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE
NetR.dwUsage = RESOURCEUSAGE_CONNECTABLE
NetR.lpLocalName = "G:"
NetR.lpRemoteName = "\\share"
WNetAddConnection2(NetR, "pass", NULL, CONNECT_UPDATE_PROFILE)
This would be the same as net use G: \\SERVER\share pass
This is fine under 95/98.
But under NT4, I need to specify the domain & username such as
net use G: \\SERVER\share /user:domain\username pass
How do I do this with VB code? Is there something else other then
WNetAddConnection2 that can do it?
Please help!