I am developing a SSIS package with Package deployment model on SQL Server 2016 environment. I have a File Move functionality which is running fine from Visual studio and also when it is run manually from command prompt using below command
"C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" /F "D:\project\Package1.dtsx"
When the same is schedules from Task scheduler Files are not moved from one folder to another on the same system.
initially I used File System Task which also behaved as explained above. later I replaced it using Script task and wrote below line of code. Still it is not working.
try
{
System.IO.File.Move(Convert.ToString(Dts.Variables["User::FileName"].Value), Convert.ToString(Dts.Variables["User::ProcessFolder"].Value));
}
catch (Exception)
{
}