Re: Map a network drive in win32 service program before user logon.



codexman wrote:
> To MVPs & professionals,
>
> We write a win32 service program using c++. When Service starts, it
> will create a thread to read files from a share folder of the other
> server, such as \\serverx\sharefolder\*.*. There are 3 problems,
> (1) When the service is running under LocalSystem account, why it can
> not access share folder on XP / 2003 server or 2000 server using
> FindFirst()?

Becuase LocalSystem account usually doesn't have network credentials. Use
NetworkService or designated user instead.

> (2) We change the account to administrator, service can access the
> share folder on 2000 server / 2003 server. But, service still can not
> use FindFirst() to read files from XP's sharefolder. (all
> sharefolders have granted to Guest account)

Check NTFS permissions on the folder. Both share permissions and NTFS
permissions must grant the access.

> (3) We try to use WNetUseConnection() in our service program, it
> seems can solve the problem, but our service will crash after several
> hours.

Fix the bugs.

--
Eugene
http://www.gershnik.com


.



Relevant Pages

  • Re: SMS Permissions
    ... I wouldn't mess around with the ntfs permissions, ... account or the localsystem account. ... You will have to do with sms class & instance permissions. ...
    (microsoft.public.sms.setup)
  • Re: FileExists with UNC Path with a Service.
    ... Is the service running under a specific account, ... I ask because the LocalSystem account doesn't have any ... if your UNC specification is referring to a different ... > I did check the permissions, and added my computer (thinking that it was a ...
    (microsoft.public.vb.general.discussion)
  • Re: Default sqlservice account permission in local machine
    ... Not positive I understand your question, but are you referring to the ... LocalSystem account? ... can be cut and pasted into Query Analyzer is appreciated. ...
    (microsoft.public.sqlserver.security)