pattone Posted December 22, 2023 Share Posted December 22, 2023 Hi guys... I'm trying to run ccleaner in command line from a bat file and when I run it with the /DELETE /METHOD it ask me for confirmation like the picture attached... is there a way to accept that "DELETE" to run that command using Task Scheduler? The command that I'm running is: Quote ccleaner.exe /DELETE "C:\Users\Usuario\Downloads\*.*" /METHOD 1 Link to comment Share on other sites More sharing options...
Moderators nukecad Posted December 22, 2023 Moderators Share Posted December 22, 2023 I don't call CCleaner from my own cleaning batch file. If you are cleaning all the files in a directory from a batch file then why not just use the "del" command with the /q option. eg. For your example above I'd use: Del /q C:\Users\Usuario\Downloads\*.* >nul 2>nul /q stops it asking to delete each file. You could also use /s after the /q to clear any subdirectories. https://www.lifewire.com/delete-command-2625859 The two nul statements at the end of the line supress standard output and non critical errors from the screen. Without those it would output a list of all files deleted, or an error if the directory is already empty. Try it without them to see what I mean. *** Out of Beer Error ->->-> Recovering Memory *** Worried about 'Tracking Files'? Worried about why some files come back after cleaning? See this link:https://community.ccleaner.com/topic/52668-tracking-files/?tab=comments#comment-300043 Link to comment Share on other sites More sharing options...
pattone Posted December 22, 2023 Author Share Posted December 22, 2023 (edited) 39 minutes ago, nukecad said: I don't call CCleaner from my own cleaning batch file. If you are cleaning all the files in a directory from a batch file then why not just use the "del" command with the /q option. eg. For your example above I'd use: Del /q C:\Users\Usuario\Downloads\*.* >nul 2>nul /q stops it asking to delete each file. You could also use /s after the /q to clear any subdirectories. https://www.lifewire.com/delete-command-2625859 The two nul statements at the end of the line supress standard output and non critical errors from the screen. Without those it would output a list of all files deleted, or an error if the directory is already empty. Try it without them to see what I mean. I'm trying to use Ccleaner with the /METHOD 1 parameter for secure erase; "del" command doesn't execute a secure erase https://support.ccleaner.com/s/article/command-line-parameters-for-ccleaner-for-windows?language=en_US Edited December 22, 2023 by pattone Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now