Thursday , July 18 2019

Removing Large File structures using PowerShell

Open Powershell Run as Administrator. Browse to the Location to be Safe.

image

Get-ChildItem -Recurse | Remove-Item -recurse -Confirm:$false -Force –verbose

image

Now File Structure under Junk folder and its subfolders is Removed without any confirmation.

If you get into this below error –

The Specified Path , File Name or Both are too long. The Fully qualified file name must be less than 260 Characters, and the directory name must be less than 248 Characters

image

Now in this case use Robocopy nothing need to be installed on Latest windows Machines.

Create a Empty Folder

image

Now ask robocopy to Mirror this empty folder to the destination folder.

robocopy /MIR c:\S C:\Junk

Now File Structure under Junk folder and its subfolders is Removed without any confirmation.

image

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Migrate CA From 2008 R2 to Windows 2016

Microsoft Certificate Authority becomes a key server if its integrated to Critical Services like Meraki,Skype ...

Leave a Reply

Your email address will not be published.