search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Renaming all file names in a directory with Powershell
Posted in Windows Powershell | No Comment | 5,104 views | 27/06/2010 21:46

If you use Flashget, sometimes it downloads files with .html extension. You have to trim .html extensions from files but if you download so many files, you need to use script to save your time.

$files = dir
foreach ($file in $files)
{
$new=$file.name.replace(".html","")
ren $file $new
}

Simply, I use basic dos command, ren to rename files. But you can use Rename-Item to make it 100% Powershell :)



Leave a Reply