• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Delete files from sub-folders

Vernon27

Member
Hello Group,

I will like to know if I can accomplish the following with Tasker:

Background information:

Samsung Galalxy Note 3 (SM-N900V) running Lollipop 5.0 (not rooted); Tasker version 4.7u3m

Issue: I have 109 directories for podcasts audio and video files created when I susbscribed to podcasts using the BeyondPod application which instatalled on the phone. On Friday evening, I manually copy the Podcasts directory to my local drive and I run a batch file with the following commands:

@echo OFF
cd \Temp3\Podcasts
forfiles /S /M *.* /C "cmd /c del @file"

What this batch file does is delete all the files (not directories) in the Podcasts directory. Then I manually copy the Podcasts directory back to my phone overwriting the one that is already there. The end result is the sub-directories in the Podcasts directory are empty. This saves me from having to go into each sub-directory and manually delete each file(s) out of the Podcasts sub-directories.

What I would like from Tasker: I would like to create a Profile and Actions to have Tasker automate the above process.

What I have done so far: Created the batch file to delete the contents of the sub-folders in the Podcasts folder; I know how to list files using the Tasker command and I know how copy files using Tasker.

Roadblocks: Not certain if Tasker can copy files to a local computer drives unless it can verify that the device is connected to the local computer. I can change the batch file to run the command on the phone.

Thanks in advamnce for your assistance.

Vernon27
 
Hello All,

Is there a way for Tasker to run a .bat file? The file contains the commands to delete the contents of each folder. As for copying the folders to my local drive I can skip that step and run the .bat file directly on the phone.
 
Back
Top Bottom