Link to home
Start Free TrialLog in
Avatar of haider
haiderFlag for Pakistan

asked on

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

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.
Avatar of zzynx
zzynx
Flag of Belgium image

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.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of haider

ASKER

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???
>>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)