Run a command every X days

Hi All-

How would I run “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8” every 30 days? I guess we have an issue with scheduled tasks in our environment so I would need to include the date range in the script itself. Any ideas?


You have an “issue” with scheduled tasks, or a “problem” with them?

I mean, I’d just do this as a scheduled task. PowerShell doesn’t have any way of waking up and running a script on its own, it would just use a scheduled task for that.

Yea the Windows “AT” scheduler used to have a run every X days but Starting with Server 2012 the at command is no longer there. The syntax was pretty tough but they had a GUI in the Windows 2000 Resource Kit.

Showing my age there. =)

However if you’re running Windows 8 or Server 2012 you are out of luck Microsoft finally did away with it. Don’s right schedtasks is your best way but I don’t know of a way to make it do it every 5 days regardless of date or day of the month. But if your 2008 or older you’re in business.


Thank all. I guess my issue is that I need to delete the temp internet files on a schedule. I cant seem to do this with any other command than “RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8”. I run

$dir = “C:\Users.…\AppData\Local\Microsoft\Windows\Temporary Internet Files”

Get-ChildItem $dir -Recurse -Force

But I only see to see the content.ie5 folder but not the files. With that said I cant leverage .lastwrite time in order to delete the file if its 30 days old.

Any ideas as to why the command above does not show me the files and only the content.ie5 folder? << Download Windows 2000 Resource Kit

WinAT is way down towards the end of the list keep scrolling.