Jump to content

/AUTO command line parameter does not work with cCleaner64.exe


ronjacq

Recommended Posts

I recently installed cCleaner on a new Toshiba 64 bit laptop running Windows 8. cCleaner runs fine if I start it from the Desktop icon; however, if I execute it in a .bat file with the /AUTO parameter, the program opens and closes in a split second and performs no cleaning actions. If I remove the /AUTO parameter from the command, cCleaner opens normally allowing me to interact with the software. I never had this issue on my old XP machines.

The command I execute is: c:\"program files"\cCleaner\cCleaner64.exe /AUTO Any advice would be appreciated.

Link to comment
Share on other sites

  • Moderators

Hi ronjacq, and welcome to the forum.

 

I'm no expert on command line, but I think your quotation marks may be off.

 

"C:\Program Files\CCleaner\CCleaner64.exe" /AUTO

 

Try that, it works on my XP machine and runs a flashing CCleaner icon in the systray.

Edited by DennisD
: Tried it out.
Link to comment
Share on other sites

Thanks Dennis. When I ran your command as the target of a shortcut, it worked fine on my Windows 8 machine; however, when I ran it as one of several commands in a batch file it didn't seem to recognize the /AUTO at all but also did not open the cCleaner application normally either. Ron Kaplan

Link to comment
Share on other sites

  • Moderators

It might help if you copy and paste the contents of the batch file Ron.

 

Some of the guys on here are well versed in this stuff, and I'm sure if there's something not quite right they'll spot it.

 

I don't have Win8, but I have seen a few mentions via google that Win8 is unlike previous Operating Systems and answer 1 (the only one) here may make some sense to you ...

 

Turns out there is nothing to do with the administrator privilege.The problem is about the default System PATH variables on Windows 8 ,which is completely different from the previous versions.

 

http://superuser.com...le-on-windows-8

 

If that doesn't help, we have a number of Win8 users who I'm sure will contribute to the topic.

Link to comment
Share on other sites

Another possibility might be

START "C:\Program Files\CCleaner\CCleaner64.exe" /AUTO

 

If that fails then launch CMD.EXE and invoke

START /?

That will probably show you two screens of extra options to try.

Link to comment
Share on other sites

Thanks DennisD and Alan_B for all your good advice. I was working on this last night and also found my way to superuser.com and other sites which recommended the "start" command. I tried several iterations of it to no avail. However, the advice to look up all the parameters of the "start" command via the command prompt by entering "start /?" yielded some good ideas.

 

My batch file follows:

 

Echo %Date% %Time% %1 cClean and Restart Procedure

::

start /d "c:\Program Files\CCleaner\" /i /wait CCleaner64 /AUTO /RESTART

::

:: start /wait shutdown -f -R -t 00

 

 

The key was putting the path in the /d parameter and leaving the command by itself free of quotation marks. The /wait parameter does not work, however, so when I first tried it with the Shutdown command not commented out, below the ccleaner command, the shutdown initiated immediately upon the start of the ccleaner program. Thus it shut it down immediately before it could do its work. I settled on using the /SHUTDOWN ccleaner parameter instead. It would be nice to know how to keep the batch file from progressing until the ccleaner command was complete.

 

Thanks again for all your help. Ron

Link to comment
Share on other sites

  • Moderators

Why do you need the extra shutdown command /restart takes care of that

 

ADVICE FOR USING CCleaner'S REGISTRY INTEGRITY SECTION

DON'T JUST CLEAN EVERYTHING THAT'S CHECKED OFF.

Do your Registry Cleaning in small bits (at the very least Check-mark by Check-mark)

ALWAYS BACKUP THE ENTRY, YOU NEVER KNOW WHAT YOU'LL BREAK IF YOU DON'T.

Support at https://support.ccleaner.com/s/?language=en_US

Pro users file a PRIORITY SUPPORT via email support@ccleaner.com

Link to comment
Share on other sites

The /wait parameter does not work, however, so when I first tried it with the Shutdown command not commented out, below the ccleaner command, the shutdown initiated immediately upon the start of the ccleaner program. Thus it shut it down immediately before it could do its work.

I think that /WAIT works but not the way you think :(

This is different between XP and Windows 7, and no doubt Windows 8 is worse, but in Windows 7 I see two conditional IFs

WAIT Start application and wait for it to terminate.

command/program

If it is an internal cmd command or a batch file then

the command processor is run with the /K switch to cmd.exe.

This means that the window will remain after the command

has been run.

 

If it is not an internal cmd command or batch file then

it is a program and will run as either a windowed application

or a console application.

No - I do speak Geek but not well enough to explain that :wacko:

 

Additional - and possibly very relevant :-

I The new environment will be the original environment passed

to the cmd.exe and not the current environment.

My memory of this is that if you launch Windows Task manager and select Processes TAB,

when you run launch your BAT script then Processes will show a new instance of CMD.EXE which is executing your script commands,

and the "/I" option will launch an extra instance of CMD.EXE to run CCleaner64.exe through to completion,

and the first instance of CMD.EXE has completed its responsibility when it launches the second instance,

so the first instance does not WAIT any longer - NB there is no way for the second instance to tell the first instance when it has finished.

 

I think you will get different and more understandable results if you remove the "/I" option.

Link to comment
Share on other sites

Answers to the last two posts. The reason I was using the SHUTDOWN command rather than the /SHUTDOWN ccleaner parameter was that on my old XP machine, the /SHUTDOWN parameter waited nearly a minute to act, whereas, I could code "T00" on the SHUTDOWN command to make it run immediately.

 

I tried removing the "/i" parameter, however, the script did not wait for the ccleaner program to close. It ran my SHUTDOWN command immediately. I also tried using the "/B" parameter to not run ccleaner in another window and got the same results just described.

 

As for the description of the "/wait" parameter, I agree that the language is rather ambiguous to me as well. I am satisfied using the ccleaner /SHUTDOWN parameter for now and will continue to nose around for a way to have the batch file wait for the program initiated by the "start" command to complete.

Link to comment
Share on other sites

This works for me on Windows 7


REM CD /D H:\UTILS\CCleaner\
START /WAIT CCLEANER64.EXE /DEBUG
REM CCleaner has now closed and debug output file is ready for access

It works for the option /DEBUG and for the other option switches also,

The magic bit is probably keeping it simple without the complication of preceding the /WAIT with the complication of

/d "c:\Program Files\CCleaner\"

or in my special case of a different Portable path

/d "H:\UTILS\CCleaner\"

 

As a first step I started the script with

CD /D H:\UTILS\CCleaner\

hence there was no need for the ugly

/d "H:\UTILS\CCleaner\"

 

Once my script was placed on the path H:\UTILS\CCleaner\ there was no need for

CD /D H:\UTILS\CCleaner\

because the desktop shortcut already set up the path which held both the BAT script and the CCleaner64.exe

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.