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…
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"
exit
}
$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.
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.