Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now