batch file?

I have a batch file that I wrote that I want to run every night on my computer at work. When I run the batch by right clicking it and telling it to run as administrator it runs fine. But when I create scheduled task and try to run it there with highest privaliges ccleaner does not appear to do anything. But the rest of the programs in the batch file run? One thing I noticed is the command line box never comes up when the batch file is running as a scheduled task. Here is my batch file. Any ideas? Thanks.

ipconfig /flushdns

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

"C:\Program Files\Microsoft Security Client\MpCmdRun.exe" -signatureupdate

"C:\Program Files\Microsoft Security Client\MpCmdRun.exe" -scan -2

timeout /t 120 /nobreak

shutdown.exe /s

OS version?

it could be based on what you mean by highest privileges.

I am using Windows 7 pro. I also tried to run it on my pc at home as well. That machine is also running Windows 7 pro.

As what user is the task running? If system then ccleaner is cleaning the system's profile. Try replacing the ccleaner part with a runas command, then to counter UAC use the same arguments that ccleaner uses to run it's skip UAC option.

I could be wrong of course, @Alan_B is really good at batch files.

I think I got it figured out. When I was checking to see if ccleaner was running or not I was looking at to see if the recycle bin was emptied or not. What I found this morning. Is that appears the recycle bin desktop icon is not always correct. The icon would be the version with paper in the can. But when I checked to see if anything was actually in the recycle bin it was empty. I am now thinking that ccleaner is running like it is supposed to. I was getting the idea that it was not from the recycle bin icon not updating to an empty status.