0

I'am trying to setup a script to monitor a local folder and to copy the file when they appears.

i'am using task scheduler to initiate the script at startup (had to set it running as System (not working with another account) I need credential to acces th UNC path so i'am trying to launch the robocopy using domain account credential but no luck access denied when trying to psexec another cmd script i'am really stuck with that, all script are working if someone logon ...

Thanks for your help enter image description here

4
  • If it is a local folder, why do you use PSEXEC?
    – Leshy
    Commented Sep 23, 2020 at 10:59
  • I copy file from a local folder to a network share, i need the credential to access the share and net use doesn't work as it seems there is no drive letter before someone logon the computer Commented Sep 23, 2020 at 11:12
  • 1
    Did you define the task as requiring logon? Why do you need psexec?
    – harrymc
    Commented Sep 23, 2020 at 12:26
  • Task must be run by System account... if I choose another user, the task doesn't start (trigger on startup) Commented Sep 24, 2020 at 7:11

1 Answer 1

0

Lets give a name to the PC on which your local folder(in my example, I will call it BackUp folder) resides and your BackUp task should run. I will name it "PC1"

  1. Create or use already created user with at least Read rights to your BackUp folder, beside that, your user acc on PC1 has to be a member of Backup Administrators group or equivalent - I'll call this user Leshy.
  2. Log into PC1 with Leshy acc, connect to desired Shared folder with acc that has Write permission on it and save those credentials. Or you can expand your script in a task to make a new connection with net use every time the task runs.
  3. In Task scheduler, create your backup task, one that will call your backup script, configure it as you like, just don't forget one thing, in General tab choose option "Run whether user is logged on or not". You will have to provide Leshy acc credentials and that should be it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .