KevinAverage Posted May 20, 2015 Share Posted May 20, 2015 This is probably not relevant to the CCleaner forum as its not a CCleaner issue as such but I wondered if anyone has tried this. I'm trying to create a batch file to run CCleaner and then shutdown the PC. At the moment the code is as follows: Main file: SET BatPath=D:\AA_BACKUP\UserData\Batfiles call %BatPath%\RunCCleaner.bat %windir%\system32\shutdown.exe -s -t 60 -c "This PC is being cleaned & will be shut down" The 'RunCCleaner.bat' is as follows: call C:\"Program Files"\CCleaner\CCleaner64.exe /AUTO As you can see, the main file 'waits' 60 seconds before it invokes 'shutdown.exe'. The 60 second wait was just trial and error, and it works, but I'd like it to be a bit more sophisticated in that I'd like the shutdown.exe to be invoked when CCleaner has finished, rather than wait the arbitrary 60 seconds. I've tried using the following instead but I think that due to the way command line works, the wait switch is ignored: start /wait C:\"Program Files"\CCleaner\CCleaner64.exe /AUTO This is where I've hit the wall. I'd really appreciate some help if it can be done. Thanks! Link to comment Share on other sites More sharing options...
dvdbane Posted May 20, 2015 Share Posted May 20, 2015 well, you can add /SHUTDOWN after /AUTO so no need to run shutdown.exe look here https://www.piriform.com/docs/ccleaner/advanced-usage/command-line-parameters better if you use Task Scheduler Link to comment Share on other sites More sharing options...
trium Posted May 20, 2015 Share Posted May 20, 2015 Versions of CCleaner Cloud; Introduction Ccleaner Cloud; Ccleaner-->System-Requirements; Ccleaner FAQ´s; Ccleaner builds; Scheduling Ccleaner Free Es ist möglich, keine Fehler zu machen und dennoch zu verlieren. Das ist kein Zeichen von Schwäche. Das ist das Leben -> "Picard" Link to comment Share on other sites More sharing options...
keithg Posted May 22, 2015 Share Posted May 22, 2015 You can use a single batch file like the following: C:\"Program Files"\CCleaner\CCleaner64.exe /AUTO %windir%\system32\shutdown.exe -s -t 60 -c "This PC will be shut down in 60 Seconds" Link to comment Share on other sites More sharing options...
Moderators Andavari Posted May 22, 2015 Moderators Share Posted May 22, 2015 You can use a single batch file like the following: C:\"Program Files"\CCleaner\CCleaner64.exe /AUTO %windir%\system32\shutdown.exe -s -t 60 -c "This PC will be shut down in 60 Seconds" Won't work where you have the quotes placed. Link to comment Share on other sites More sharing options...
KevinAverage Posted July 28, 2015 Author Share Posted July 28, 2015 Actually the purpose of all this was to be able to do a clean and restart using the following in the main file: %windir%\system32\shutdown.exe -r -t 60 -c "Clean & Restart" This is something that CCleaner won't do, so I tried to come up with something myself. BTW I tested the double quote issue - it works fine either as is, viz. C:\"Program Files"\CCleaner\CCleaner64.exe /AUTO or like this: "C:\Program Files\CCleaner\CCleaner64.exe" /AUTO 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