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.
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
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.
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
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.
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
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.
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.