1

On Server 2016, I'm trying to copy a file to a synology drive. I want the scheduled task to perform this task, without me being logged in.

The network path, requires a username and password.

NET USE I believe has to be in the context of the locally logged-in account.

Or do I have to add an FTP service on the server, then I can do this?

1 Answers1

0

A Scheduled Task requires you to specify an account for running the task. Each action the task performs will be executed in the context of this account, even commands like net use.

Example for running a Script with Task Scheduler: here

net use even allows you to connect a share with a different account.

copying itself is in my opinion best don by the good old robocopy, especially for larger transfers.

Using Powershell in a user context, which has the correct permissions, you would be able to use Copy-Item with UNC paths and therefore it wouldn't require you to first connect a drive. (which would by the way also be possible with robocopy)

There are al lot of finished solutions to this topic which you can easily find online.

Manu
  • 704
  • 2
  • 19