Map a network drive to be used by a service

前端 未结 12 2174
再見小時候
再見小時候 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:39

    I found a solution that is similar to the one with psexec but works without additional tools and survives a reboot.

    Just add a sheduled task, insert "system" in the "run as" field and point the task to a batch file with the simple command

    net use z: \servername\sharedfolder /persistent:yes
    

    Then select "run at system startup" (or similar, I do not have an English version) and you are done.

提交回复
热议问题