diff --git a/cckdownload.ps1 b/cckdownload.ps1 index 5d822d6..2125724 100644 --- a/cckdownload.ps1 +++ b/cckdownload.ps1 @@ -5,10 +5,10 @@ $remotePassword = "your_password" # Replace with your password for the remote s $remotePath = "/volume/autobackup" $localPath = "D:/Shared/unifibackup/" $zipFileName = "backup_$(Get-Date -Format yyyy-MM-dd).zip" -$pscpPath = "C:\path\to\pscp.exe" # Update with the correct path to pscp.exe -$localTempFolder = "$env:TEMP\autobackup" +$pscpPath = (Join-Path -Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -ChildPath "bin\pscp.exe") +$localTempFolder = (Join-Path -Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -ChildPath "temp") -# Create temporary folder +# Create temporary folder if it doesn't exist if (-Not (Test-Path $localTempFolder)) { New-Item -ItemType Directory -Path $localTempFolder | Out-Null }