I've got an SQL Server Agent job that runs an SSIS job on server X every night. The SSIS job copies from files on server Y which works just fine just that I need to delete the files every now and then.
I've bit of code that I run in a .bat file that works just fine if I run it on server Y. However, if the SSIS package on server X runs it it doesn't seem to have sufficient rights to execute it.
forfiles /p "\\NetworkPathBlaBla" /s /d -30 /c "cmd /c del @file : date >= 30 days >NUL"
The SQL Server Agent is using a proxy to run the SSIS. How can I add these credentials to the bat file on server Y?