Solved

acess share folder, getting error, but why???

Posted on 2002-06-20
4
266 Views
Last Modified: 2013-11-20
I am using WNetAddConnection2 function to access share folder. Everything works fine if I use it through an application, but when I use same code from a windows service then I get this error. What could be the reason.

error number 1219 (The credentials supplied conflict with an existing set of credentials).

plz HELP me.
0
Comment
Question by:haider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 7098348
Hi,

You get this message when another connection exists already (or still) between your computer and the one you try to connect with (i.e. accessing a shared folder) but with a different name-password pair.

So, try to determine who's connected to that computer.
On WinNT for example choose "Server" in the control panel and then click the "Users" button.

I expect you to see a connection you weren't aware of.

Bye.
0
 
LVL 86

Accepted Solution

by:
jkr earned 150 total points
ID: 7098519
You cannot access *any* network functions from a service when this service is set to run under LocalSystem. To overcome this, make sure to assign your service to run under a predefined user account (preferrably one belonging to the admin group) which does have network access (this is usually done by specifying an account name&password in the call to 'CreateService()', but you're also able to change this from the 'services' control panel applet).
0
 

Author Comment

by:haider
ID: 7112964
I am using smae technique and passing user name and password in "CreateService", but I am getting error in system log. Error is "Logon failure: the user has not been granted the requested logon type at this computer.". I am using administrator account user name and password. What could be the reason???
0
 
LVL 86

Expert Comment

by:jkr
ID: 7113839
>>What could be the reason???

You have to assign the 'Logon as a service' provilege to the account you are using. If you are using NT, you can do that using the user manager, on W2k, the 'Local Security Policy' MMC will allow you to do that (execute "mmc secpol.msc /s" on the command line)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 59
Separate into files by filename 12 92
Problem to App source 6 120
Authenticate using sesu from script 7 160
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question