This topic contains 4 replies, has 3 voices, and was last updated by
April 10, 2014 at 6:22 am #14444ParticipantPoints: 0Rank: Member
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?
April 10, 2014 at 6:53 am #14447KeymasterPoints: 1,704Rank: Community Hero
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.
April 10, 2014 at 7:11 am #14449ParticipantPoints: 1Rank: Member
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.
April 10, 2014 at 7:16 am #14451ParticipantPoints: 0Rank: Member
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?
April 10, 2014 at 7:18 am #14452ParticipantPoints: 1Rank: Member
http://www.petri.co.il/download_free_reskit_tools.htm << Download Windows 2000 Resource Kit WinAT is way down towards the end of the list keep scrolling. -VERN
The topic ‘Run a command every X days’ is closed to new replies.