Thanks for your reply. I run this application in windows 7 and its working fine. The problem occurs when when I executed my application on system start up. Because WNetAddConnection function is provided only for compatibility with bit versions of Windows. The content you requested has been removed. Ask a question. Quick access. Search related threads. Remove From My Forums.
United States English. Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. Configuration Manager - Site and Client Deployment. Post questions here that are appropriate for the installation and setup of Configuration Manager sites and clients. Before posting, please search for your answer in these forums and the TechNet documentation. Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services.
Privacy policy. The WNetAddConnection function enables the calling application to connect a local device to a network resource. A successful connection is persistent, meaning that the system automatically restores the connection during subsequent logon operations. A pointer to a constant null -terminated string that specifies the network resource to connect to. A pointer to a constant null -terminated string that specifies the password to be used to make a connection.
This parameter is usually the password associated with the current user. If this parameter is NULL , the default password is used. If the string is empty, no password is used. Learn more. Asked 11 years, 7 months ago. Active 7 years, 7 months ago. Viewed 12k times.
Improve this question. Flavio Flavio 31 1 1 gold badge 1 1 silver badge 2 2 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. Walt Walt 1 1 silver badge 7 7 bronze badges. Oleg Oleg k 32 32 gold badges silver badges bronze badges. I'm trying to use LogonUser because I've read in the MS documentation that the LocalSystem account can't establish authenticated connections to remote computers, so the idea is to first impersonate a user that can establish connections i.
If you has no trust between source and destination computers a local login with LogonUser can fail because your local computer must not knows a user from remote computer. By the way if both computer are in the same Domain then connection to remote computer can do works with the computer account see msdn.
0コメント