This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I am using the run command tool to write and run a batch file that will delete old files from a shared drive. This workflow writes the file correctly and I can even run it by double-clicking. However, the workflow cannot run the very same file. It gives me an Error code 1. I have already searched Alteryx Community for help and found a few things but nothing I have found has helped me resolve this issue.
Here is what is in my batch file. It is just one line that deletes all CSVs that are more than 1 day old.
Our posts may have crossed paths so FYI I just updated my last post with better explanation.. in case you missed it.
That said, I think I need the forfiles because I'm deleting a batch of files from the previous day. What's happening is that I have a separate workflow that creates the files with a timestamp in the name that gets generated every 20 minutes. This workflow runs 24/7, so... lots of CSV's being generated. Those files get sent via FTP to another location. Once the FTP is done, I can delete the files; which needs to happen because with a file being generated every 20 minutes the drive will fill up pretty quickly.
Hey so if it still doesn't work and there are files that should be deleted but aren't...
I looked into it a little more and it appears that Alteryx runs a copy of the bat file from a special location inside of it's own environment (or something to that effect). So specifying the full path might help because the local wd from %~dp0 is going to be inside alteryx (where there are no CSVs which will result in none found failure)
If that fails, it my be worth making sure none of these files are locked by other processes if you are constantly creating/transferring. But it should be skipping over all of those files from metadata so unlikely.