Can't copy files to UNC Destinations if BAT file is called via scheduled task

后端 未结 5 1678
无人共我
无人共我 2021-02-02 01:52

I have a bat file copying files from current machine to mapped network drive (one line, xcopy command).

It works when I RDP to server. However, when I run as a schedule

5条回答
  •  抹茶落季
    2021-02-02 02:34

    I was able to figure it out. Following batch files works under scheduler, even as local system account:

    net use m: \\server\share /U:server\user password
    xcopy C:\source m: /E /Y
    

    It maps a network drive every time and then copy to that drive

提交回复
热议问题