Map a network drive to be used by a service

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

    Instead of relying on a persistent drive, you could set the script to map/unmap the drive each time you use it:

    net use Q: \\share.domain.com\share 
    forfiles /p Q:\myfolder /s /m *.txt /d -0 /c "cmd /c del @path"
    net use Q: /delete
    

    This works for me.

提交回复
热议问题