March 11, 2025 at 2:34 pm
I'm trying to use forfiles in an Execute Process Task in my SSIS package to delete files older than 10 days.
When I run the cmd directly from commandline it works. But, when I run the same command from the Execute Process Task in my SSIS package nothing happens and no error is thrown. I just get "package execution completed with success"
Here are the configurations I've tried:
OPTION 1:
Executable - C:\WINDOWS\system32\forfiles.exe
Arguments - /P "C:\MY_PATH_HERE" /M *.bak /D -10 /C "cmd /c del @path"
OPTION 2:
Executable - C:\WINDOWS\system32\forfiles.exe
Arguments - forfiles /P "C:\MY_PATH_HERE" /M *.bak /D -10 /C "cmd /c del @path"
OPTION 3:
Executable - C:\WINDOWS\system32\cmd.exe
Arguments - forfiles /P "C:\MY_PATH_HERE" /M *.bak /D -10 /C "cmd /c del @path"
OPTION 4:
Executable - C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments - dir "C:\MY_PATH_HERE\*.bak" |? {$_.LastWriteTime -lt (get-date).AddDays(-10)} | del
How do I need to alter my Execute Process Task to get this to work?
March 11, 2025 at 2:56 pm
March 11, 2025 at 3:04 pm
Nevermind. Ended up being a file security issue.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy