Map a network drive to be used by a service

前端 未结 12 1978
再見小時候
再見小時候 2020-11-22 10:43

Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service\'s session when the servi

12条回答
  •  囚心锁ツ
    2020-11-22 11:36

    I can't comment yet (working on reputation) but created an account just to answer @Tech Jerk @spankmaster79 (nice name lol) and @NMC issues they reported in reply to the "I found a solution that is similar to the one with psexec but works without additional tools and survives a reboot." post @Larry had made.

    The solution to this is to just browse to that folder from within the logged in account, ie:

        \\servername\share  
    

    and let it prompt to login, and enter the same credentials you used for the UNC in psexec. After that it starts working. In my case, I think this is because the server with the service isn't a member of the same domain as the server I'm mapping to. I'm thinking if the UNC and the scheduled task both refer to the IP instead of hostname

        \\123.456.789.012\share 
    

    it may avoid the problem altogether.

    If I ever get enough rep points on here i'll add this as a reply instead.

提交回复
热议问题