Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect to Networked Machine
Message
General information
Forum:
Visual Basic
Category:
Windows API functions
Miscellaneous
Thread ID:
00599532
Message ID:
00599544
Views:
9
>I am trying to access data on a machine on my network. I am receinving a message box that says
>
>Incorrect password or unknown username for:
>
>Then it asks for a username and password. This only happens the first time I try and connect to the machine. The system remembers the information after this. Is there any way to accomplish this via code or an API call?
>

Yes - WNetAddConnection2() or WNetAddConnection3() in the Windows API allow you to log into a remote share and specify a user name, domain and password, even without mapping the UNC to a local resource (an example can be found in my NETRESOURCE class); You can use the Wscript.Network MapNetworkDrive method could be used - see the WSH links in my sig block for details, or the command line NET USE command built into Win32 operating systems will allow you to specify a user name and password.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform