task scheduler creating backup, but saving to wrong location

Leah 1 Reputation point
2022-05-23T20:13:50.147+00:00

I have a task set up to create a scheduled daily backup. I am trying to have the zip file sent to this specific location: C:\FCCS\Backup\FCCSBackup.ps1

However the zip files are saving to this location: C:\Windows\System32

Attached are two screenshots; the first one is of the details of the Action in Task Scheduler. The second screenshot is of the location the files are being sent to.

Any idea why this is happening and how I can fix it?

204769-untitled1.png204842-untitled.png

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,344 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 44,541 Reputation points
    2022-05-23T21:38:57.043+00:00

    Nobody knows what's in the script you're running. If it doesn't set (or specify) the correct location in which to store your data, then you need to fix that in your script -- or maybe add the directory in the "Start in" box.

    0 comments No comments

  2. Limitless Technology 43,916 Reputation points
    2022-05-26T07:36:30.66+00:00

    Hello

    Thank you for your question and reaching out. I can understand you are having issues related to scheduled daily backup path location.

    Please check from script if its using Generic path variable like $Path then it should take default path C:\Windows\Sytem32

    You can also use Script Tracing and Logging which should save debug logs of PowerShell execution.

    Start-Transcript -path "C:\BackupLog.txt"

    Stop-Transcript

    https://learn.microsoft.com/en-us/powershell/scripting/windows-powershell/wmf/whats-new/script-logging?view=powershell-7.2

    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments