PowerShell Script

SynergyTechnology
SynergyTechnology used Ask the Experts™
on
I am looking for a power shell script which deletes all *.tmp files from all folders on the c:\
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
Commented:
remove-item c:\* -include *.csv -Recurse -WhatIf

(remove -whatif if results are as desired)
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
Commented:
Of course you want to replace *.csv with *.tmp ;-)
Top Expert 2007

Commented:
Well yeah, but that's the reason for the whatif! ;^)
Thanks Qlemo - good catch
Bill PrewIT / Software Engineering Consultant
Top Expert 2016
Commented:
Powershell can handle this, but you can also do it with the basic DEL command, as in:

del /s /q /f c:\*.tmp

Open in new window

~bp
this is also a pretty cool script for doing it:

https://community.spiceworks.com/scripts/show/3359-cccleaner

jamie

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial