Deploying scheduled tasks

I want to deploy an exe that is set up in task scheduler multiple times (different arguments).

Is it possible to configure Octopus Deploy to switch path on tasks in Task Scheduler?
So that running tasks continue to run, but the next time they are started, they will run from the new path…

Hi Erik,

Octopus provides PowerShell scripting for these kinds of tasks - is what you’re aiming for achievable with PowerShell?


This would be a nice Configure features. True you can do it with the deploy.ps1, however, having a nice UI to do it would be great.

+1 for this.

Hi All,

I have created this suggestion in UserVoice
We don’t use the forums for suggested features, this is the best place to go and vote and add your comments, as we don’t want this lost!



We have the same need but we’ve solved this using junction paths in Windows and then use the deploy-script to update the junction directory during deploy like this:
$deploymentDir = resolve-path .
if (!(Test-Path ($deploymentDir))) {
Write-Host "Missing file for variable deploymentDir : $value"
$junctionDir = "c:\TasksJunction"
if ((Test-Path ($junctionDir))) {
Write-Host "Remove link to previous version:"
cmd /c dir c:\ | %{ if ($_ -like ‘JUNCTION’) { Write-Host $_ } }
cmd /c rmdir “$junctionDir”
cmd /c mklink /j/d “$junctionDir” “$deploymentDir”`

And then we reference the junction path in our Windows Scheduled Tasks.

Hope this might be helpful to someone :slight_smile:

Kjetil Klaussen

Hi Kjetil,

Thank you very much for your solution. I just found in buried in our spam folder, so I apologize for the delay.
But now for anyone who finds this thread they have a great solution.