Solved

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

Posted on 2002-06-20
4
267 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

628 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