Thread: Setting account for CAtlServiceModuleT

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    4

    Setting account for CAtlServiceModuleT

    The problem is simple:
    To make a service implemented through inheritance from CAtlServiceModuleT to pull/copy files from another location on the network.

    We attempted to use CopyFileEx function to cpy the files but it fails with Error message: "Operation Succeeded" ...
    We believe that its due to lack of permissions. Is there a way to set it to run through NetworkService account?

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Call ChangeServiceConfig or modify the ATL source to use the Network Service account, though I doubt moving to an account with less privileges will help with a lack of permissions problems (if that's what it is).

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    4
    Quote Originally Posted by adeyblue View Post
    Call ChangeServiceConfig or modify the ATL source to use the Network Service account, though I doubt moving to an account with less privileges will help with a lack of permissions problems (if that's what it is).
    adeyblue thank for the advice but it didn't help. The service dies immediately if started under any account other then Local Service.

    The problem is the fact that Local Service does not have the permission to copy a file from a shared folder, therefore a different account with network privileges should fix the problem ...

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by Roader View Post
    We attempted to use CopyFileEx function to cpy the files but it fails with Error message: "Operation Succeeded"
    did you check to see if the file was copied? I've seen plenty of cases where something didn't fail, but returned that message, because the return value of GetLastError() was non-zero. in my opinion, it's likely that the operation did, in fact, succeed, and you need to write your if statement to ignore that error code.

  5. #5
    Registered User
    Join Date
    Jul 2009
    Posts
    4

    Unhappy

    Quote Originally Posted by Elkvis View Post
    did you check to see if the file was copied? I've seen plenty of cases where something didn't fail, but returned that message, because the return value of GetLastError() was non-zero. in my opinion, it's likely that the operation did, in fact, succeed, and you need to write your if statement to ignore that error code.
    Yes I checked ... its not there and the copy source and destination addresses are correct ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bank Account Problem
    By JayBlay77 in forum C++ Programming
    Replies: 1
    Last Post: 03-19-2009, 08:41 AM
  2. Recursion Problem I think
    By clearrtc in forum C Programming
    Replies: 4
    Last Post: 07-31-2006, 07:10 PM
  3. Replies: 12
    Last Post: 06-03-2005, 01:13 AM
  4. Simple Bank Account Uni Project Help!!!
    By griff in forum C Programming
    Replies: 3
    Last Post: 05-09-2003, 05:49 PM
  5. hi need help with credit limit program
    By vaio256 in forum C++ Programming
    Replies: 4
    Last Post: 04-01-2003, 12:23 AM